Home Forums Chart Support Multiple data point colours on chart legend

Multiple data point colours on chart legend

Viewing 3 posts - 1 through 3 (of 3 total)
  • #43825

    Hello.

    I have used CanvasJS to create a line chart. The line chart has a single line with multiple data points, however, the data point colour changes to orange to signify a positive trend. Blue data points are used to signify a decreasing trend. Grey data points signify normal occurrence.

    How can I add these 3 different colour data points to my chart legend so that the audience understands what the Grey, Orange and Blue data points mean? E.g.I would like the legend to contain:

    – Orange ‘Increasing Performance’
    – Blue ‘Decreasing Performance’
    – Grey ‘Normal’

    Is this possible?

    I’ve added sample code to Google Drive to better explain.

    https://drive.google.com/file/d/1JKx_AZtuxqRLGukP0zJMOolpqfx6KBAL/view?usp=sharing

    Many thanks.

    #43835

    @tgriffiths,

    Legends are generally shown in dataseries level except pie, donut, funnel & pyramid charts. However, you can add dummy dataseries to achieve your requirement. Please take a look at this updated sample project.

    Dummy Dataseries to show legend for datapoints

    —-
    Manoj Mohan
    Team CanvasJS

    #43859

    Many thanks, Manoj. This is most helpful.

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

You must be logged in to reply to this topic.