Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using of onPoint.z for 'Map with overlaid pie charts' demo #21159

Open
hubaksis opened this issue May 14, 2024 · 5 comments
Open

Using of onPoint.z for 'Map with overlaid pie charts' demo #21159

hubaksis opened this issue May 14, 2024 · 5 comments

Comments

@hubaksis
Copy link

hubaksis commented May 14, 2024

This example "Map with overlaid pie charts" https://www.highcharts.com/demo/maps/map-pies uses onPoint.z property to set the size. However, returning any number from this function (like 10, 50, 200) does not change the pie chart size.
See here: https://jsfiddle.net/Guest538/tyvwbs0r/1/ lines 240-243.
Moreover, there is no mention of z property in the api docs here: https://api.highcharts.com/highmaps/series.map.onPoint

Possible workaround

Use size property.
See https://jsfiddle.net/Guest538/vq0sgahw/1/ line 244

Expected behaviour

Not sure what was the plan.

If onPoint.z property is supposed to be used, then it should work correctly and it should be mentioned in the docs.
If onPoint.z property is not supposed to be used, then demo of "Map with overlaid pie charts" should not use it.

Actual behaviour

Live demo with steps to reproduce

See here: https://jsfiddle.net/Guest538/tyvwbs0r/1/ lines 240-243.

Product version

11.4.1

Affected browser(s)

Chrome 124.0.6367.201

@hubertkozik
Copy link
Member

Hi @hubaksis!

The option onPoint.z is working correctly, you can check it here: https://jsfiddle.net/BlackLabel/7bzg8tmh/ I am returning random values 10, 20, 30, or 40 and you can see, that the dimensions of pies are different. You're right, it's not documented and it should be here: https://api.highcharts.com/highmaps/series.map.onPoint

The option size works, because you are using pie series: https://api.highcharts.com/highcharts/series.pie.size This is correct behaviour, because you can use properties from pie series in series on point pie.

Internal note:
We should add onPoint.z to the API docs.

@hubaksis
Copy link
Author

Hi @hubertkozik,

What's the meaning of onPoint.z than?
If I return a constant value instead of your random value, then despite the value the size of the pie chart is the same.
See https://jsfiddle.net/Guest538/1e9Lpw3q/ and https://jsfiddle.net/Guest538/1e9Lpw3q/1/

@hubertkozik
Copy link
Member

The onPoint.z is similar to bubble.data.z value: https://api.highcharts.com/highcharts/series.bubble.data.z

@hubaksis
Copy link
Author

Thanks, now it makes sense.

By trial and error I also figured out that onPoint has properties minSize and maxSize, which are used by z when calculating the size of the chart.
Example is here: https://jsfiddle.net/Guest538/wh9peozn/

While the documentation is being updated - can you please tell me if there is a way to make the pie chart grow when the map is zoomed in? Maybe it's also not in the docs yet :)

Thanks!

@hubertkozik
Copy link
Member

@hubaksis about minSize and maxSize there is another GH ticket: #19702 You're right, those options are working and should be documented also.

When it comes to making the pie chart grow when the map is zoomed in, I would classify it as a new Feature Request. It's not implemented right now into series-on-point module. If you would like to, you can create a Feature Request as a new GitHub ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants