Home forums Chart Support can line chart – a coloured snake based on dataVariable

Tagged: , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #14702

    Hi Canvasjs,

    i need to know how to make each x-length of a line chart (not the whole line) change colour based on a value.
    So the output would look line a normal line chart (a single ‘snake’) but with gradation of colour along the snake based on a data variable

    – say i have data values: x, y and z
    – the x and y data makes a normal line chart, no problem.
    – the z data should control the COLOUR of the line for that little bit of the line.
    – so say z can go from -5 to +5 then this would be represented in the chart by colour going from, say, red to green
    – it would be shown only in that particular segment (i.e. for that X value until the next X value) of the same single x-y line

    is it possible to override a charts lineColour ‘locally’, like this?




    Please check this jsfiddle.

    Suyash Singh
    Team CanvasJS

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

You must be logged in to reply to this topic.