Home Forums Chart Support Can the charts colors be done through UI

Can the charts colors be done through UI

Viewing 4 posts - 1 through 4 (of 4 total)
  • #34801

    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.



    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.

    changing data-series color on button click

    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.

    javascript charts with legends

    However, if you are looking to display some information within each column of the column chart, you can use index labels

    javascript chart with indexlabel

    Adithya Menon
    Team CanvasJS

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.