You must be logged in to post your query.
Home › Forums › Chart Support › Can the charts colors be done through UI
The charts are all showing up with certain colors. Now if the user would like to change the color or the have numbers appear within the chart, can it be done through the UI? Coding it will make it static and not dynamic as required.
@arvindkelvin,
You can use the set method to change the color of dataseries dynamically. Please find the code-snippet below,
$(".changeColor").click(function (e) { chart.data[0].set("color", e.target.id) });
Also, kindly take a look at this JSFiddle for an example with complete code.
— Adithya Menon Team CanvasJS
Thanks Aditya. We are evaluating canvasjs for use in all our applications and one of few things was to check if it was user controlled just like in other charts. Also can we control how the numbers show up on legend so they come within the bars in the bar charts?
You can show legend for each dataseries by setting showInLegend property. Please take a look at this documentation page for more information on legend & its customization options.
However, if you are looking to display some information within each column of the column chart, you can use index labels
You must be logged in to reply to this topic. Login/Register