Open secastro opened 1 week ago
Sorry you're running into this issue, @secastro ! This looks to be a bug that we should have addressed in the next release (hopefully later today).
So after taking a closer look at this, it's a bit of an interesting case. What's happening here is two things:
data_labels
property at the series level, Highcharts for Python is converting that into a generic DataLabel
instance (because the plot_options.series
property does not know that you are applying the data label to a Pie Series).DataLabel
class does not support the chart-type specific configuration distance
property, which is specific to the series type-specific PieDataLabel
type.This leaves us with two options for how to proceed:
plot_options.series
and into plot_options.pie
. Placing it there will yield the result you want, because then Highcharts for Python knows that you are attempting to use the PieDataLabel
type.plot_options.series.data_labels
should coerce to a series-specific data label type. Highcharts for Python supports many different series type-specific data label structures, so it's a bit of a non-trivial question as to how to handle this use case in Highcharts for Python. Highcharts JS is a little more flexible here by nature of JavaScript, but the same effect can be achieved in Python. I just need to consider what the optimum implementation will look like.
Describe the bug While trying to reproduce the example in https://www.highcharts.com/demo/highcharts/pie-chart using Python Code, setting the distance property in dataLabels is ignored.
To Reproduce This is a minimal piece of Python code to reproduce:
Also the exported chart in JSON format doesn't contain the 'distance' values
Expected behavior Ideally, the 'distance' property is preserved in the chart, and included when exported. Otherwise, a warning about the property being excluded would be useful.
Your Environment: