Home Forums Chart Support Custom labels for Y axis

Custom labels for Y axis

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

    Hi there!,
    I was wondering if it would be possible to have custom labels for the Y axis.

    Say I have a multi line chart with multiple data points; can I show the label for the data, that particular data set belongs to?

    
           |                    _x_____x
           |                   /
           |          ______ /___x 
    data 3 |   x____x/     /       \___x
           |             /              \____x                         
           |           /
    data 2 |   x____x/           
           |                           
           |
           |
           |
           |        
    data 1 |   x____x
           |         \__________x
           |                     \_____x
           |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
               A.   B.   C.   D.   E.   F.  
    
    

    In the usual line chart, the values on the Y axis are based on where the chart sets the interval value. But can it be done so that it renders it where the first data point is shown on the cart?

    Notice (in my crude drawing) the interval isn’t consistant and the labels (“data 1”, “data 2” etc) are next to the first entry in each data set.

    Would something like this be possible?
    Please and thank you.

    • This topic was modified 23 hours, 21 minutes ago by junker1224. Reason: styling
    #61324

    @junker1224,

    It’s not possible to have unequal intervals for axis labels. As a workaround, you can dynamically add striplines at the first Y-value of each series by iterating through chart.options.data. Please take look at this JSFiddle for an example of the same.

    CanvasJS Chart with Dynamic StripLines in Y Axis


    Ananya Deka
    Team CanvasJS

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

You must be logged in to reply to this topic.