Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
5020
Line Series Axis/DataSource Order of Assignment
posted

        lineSeries.xAxis = xAxis

        lineSeries.yAxis = yAxis

        lineSeries.dataSource = self // Must add data source after assigning axis otherwise SNAFU


This works.

        lineSeries.dataSource = self // Breaks x-axis

        lineSeries.xAxis = xAxis

        lineSeries.yAxis = yAxis

This is with 2015 volume 2.

Parents
No Data
Reply
  • 26458
    Offline posted

    You're correct. The chart attempts to parse the data whenever the datasource is set and it can't do so without a pair of valid axes. We'll make sure this doesn't break the chart.
    In the meantime, like you said, setting the axes before the datasource or using a chart's -addSeriesForType method does the trick. 

Children
No Data