Home forums StockChart Support Set striplines in stockcharts

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #32217

    Is it possible to set() striplines from a stockchart as you can can a standard chart? I’m looking to pull the trigger on purchase but i’m struggling. I’ve managed to update stripline base on websocket information that’s coming across, but unless the graph data is static, it disappears. Because there is no striplines set() on stockcharts, I simply set stripLines[0] to what I want it to be and render. If the chart data is static, it works a treat. If it’s async data, the chart data disappears every time the stripLine is updated. Below is a fiddle. If you attempt to zoom on the page, you’ll see the graph appears briefly until the price received from the websocket changes. If there is no change for awhile, the graph sticks around. Also, i’ve tried setting the datapoints again before rendering but after the stripLine update, but it makes no difference. If I can figure this out, I’ll be ready to purchase. I’ve commented out the dataPoints set piece after attempting to update stripLine so you can see what i’m saying.

    Working with Static data
    https://jsfiddle.net/HawtDogFlvrWtr/17s2dmx3/32/

    Not working with async data
    https://jsfiddle.net/HawtDogFlvrWtr/17s2dmx3/43/

    #32249

    @hawtdogflvrwtr,

    AJAX request is asynchronous – the operation occurs in parallel and the order of completion is not guaranteed. In your case, calling stockChart.render() soon after updating datapoints within AJAX request should work fine. Please take a look at this updated JSFiddle.

    Considering this thread as duplicate of stripLines in stockCharts acting weird. Hence closing the same.


    Vishwas R
    Team CanvasJS

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

You must be logged in to reply to this topic.