highcharts / highcharts-ios

iOS wrapper for Highcharts.
Other
127 stars 39 forks source link

Setting `HIDataLabels.enabled` to true in line plotOptions makes chart not draw #448

Closed Eskils closed 3 months ago

Eskils commented 3 months ago

This issue appears in the demo https://www.highcharts.com/demo/ios/line-labels

Extract from code:

let plotOptions = HIPlotOptions()
plotOptions.line = HILine()

let dataLabels = HIDataLabels()
dataLabels.enabled = true  // Affected property. Commenting this line / setting to false makes the chart reappear
plotOptions.line.dataLabels = [dataLabels]

plotOptions.line.enableMouseTracking = false
options.plotOptions = plotOptions

Gives the following result:

The expected result can be seen on the demo page linked above.

The same behavior occurs in the simulator and on device.
The Highcharts version used is 11.4.6

MikolajMichalczak commented 3 months ago

Hi @Eskils!

Please try using dataLabels with series object instead of line:

let plotOptions = HIPlotOptions()
plotOptions.line = HILine()

let dataLabels = HIDataLabels()
dataLabels.enabled = true
plotOptions.series = HISeries()
plotOptions.series.dataLabels = [dataLabels]

options.plotOptions = plotOptions