Home forums Using CanvasJS index label not displayed in line chart

This topic contains 4 replies, has 2 voices, and was last updated by  rajupradeep 1 month ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #25912

    Hi ALl, i am trying to display a index label in line chart along with marker colour and marker type. but the chart when rendered has a discontinuity at the exact datapoint where i want the index label to be displayed. nor there is any marker colour or type.
    for (var i = 1; i < datapoints4length; i++)
    {
    {
    if(chart2.options.data[2].dataPoints[i].y>chart2.options.data[2].dataPoints[i-1].y)
    if(chart2.options.data[2].dataPoints[i-1].y<100000)
    if(chart2.options.data[2].dataPoints[i].y>=100000)
    {
    chart2.data[2].addTo(“dataPoints”,{indexlabel:”BUY”,markerColor: “red”, markerType: “triangle”},i);
    }
    }
    }
    chart2.render();
    }

    could someone help plz,

    #25934

    @rajupradeep,

    Can you kindly create JSFiddle reproducing the issue you are facing and share it with us so that we can look into the code, understand the scenario better and help you out?


    Vishwas R
    Team CanvasJS

    #25951

    could you plz see the fiddle

    https://jsfiddle.net/0trgL6mx/

    #25954

    @rajupradeep,

    addTo method is used to add new element(datapoint) to the specified array(dataseries). Updating the marker properties of existing datapoint and re-rendering should work fine in your case. Please take a look at this updated JSFiddle.


    Vishwas R
    Team CanvasJS

    #25966

    thanks Vishwas, it worked.

    • This reply was modified 1 month ago by  rajupradeep.
Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.