Home Forums Feature Requests & Feedback Striplines – Create data tag for custom data

Striplines – Create data tag for custom data

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

    It would be great if there was the possibility to add custom data (object) to striplines when adding them to the axis.

    E.g. data that should not be displayed, but can be further used programmatically when iterating over all existing striplines on a chart axis.

    • This topic was modified 2 days, 16 hours ago by siwatec.
    #60896

    @siwatec,

    You can pass any custom property within striplines, which can then be accessed programmatically. For instance, you might include a custom property like “data” in your stripline object and this won’t be displayed, but it will be available for use in your code.

    stripLines:[
        {                
            value: 1940,
            label: "In the 40s",
            data: "my stripline"
        }
    ]

    The property can later be accessed through the chart options as chart.options.axisX.stripLines[0].data.


    Ananya Deka
    Team CanvasJS

    • This reply was modified 1 day, 22 hours ago by Ananya.
    #60899

    Thank you!

    I mistakenly tried to access the data using chart1.axisX[0].stripLines[s], and there the additional data is not accessible.

    Kind regards :)

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

You must be logged in to reply to this topic.