Home forums Using CanvasJS stripLines live access

This topic contains 2 replies, has 2 voices, and was last updated by  Wojciech 6 months, 2 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #19296

    Wojciech
    Member

    I’m trying to set stripLines to my chart. What is the setter for that? I tried like so:
    var stripLines = {
    startValue: new Date(“2017-10-21 00:00:11”),
    endValue: new Date(“2018-10-22 00:00:22″) ,
    color:”#000”,
    };
    chart.axisX[0].stripLines.push(stripLines);
    chart.render();

    What is wrong with that?

    #19306

    Suyash Singh
    Participant

    @Wojciech,

    Changing chart.axisX[0].stripLines.push(stripLines); to chart.options.axisX[0].stripLines.push(stripLines); should work fine in your case. Also, you can use addTo method to add stripLines dynamically.

    ___
    Suyash Singh
    Team CanvasJS

    #19315

    Wojciech
    Member

    Thank you Suyash,
    Works well with only one little change:
    hart.options.axisX.stripLines.push(stripLines); //no index ine axisX
    BR,
    Wojciech

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

You must be logged in to reply to this topic.