codenamezero
Posts: 22
Joined: Thu Dec 19, 2019 7:23 pm

Unable to set 'id' on column chart series?

This attribute here: https://api.highcharts.com/highcharts/s ... mn.data.id

According to the example, that only allow us to set an id on a particular point WITHIN the data? But not on the entire dataset?
https://jsfiddle.net/gh/get/library/pur ... /point/id/

Is there a way to assign an id to the column chart's series such as this?
https://jsfiddle.net/gh/get/library/pur ... lumn-basic

Code: Select all

{
   "id":"Tyokyo", // <= this is not available
   "name":"Tokyo",
   "data":[... ]
},
{
   "id":"New York",
   "name":"New York",
   "data":[ ... ]
},
{
   "id":"London",
   "name":"London",
   "data":[ ... ]
},
{
   "id":"Berlin",
   "name":"Berlin",
   "data":[ ... ]
}


I have a pie chart and a column chart.
- pie chart has 1 series and n-items
- column chart has n-series with multiple data points.

While I'm able to grab the data in the pie chart by its id, I'm not able to do so with the column chart's series. What is the proper way to assign an id to the series? I find it weird that we could give a name to it but not id?

The data that I'm feeding to the column chart is as follow:
Screen Shot 2021-04-09 at 12.30.11 AM.png
Screen Shot 2021-04-09 at 12.30.11 AM.png (169.36 KiB) Viewed 310 times
As we could see, the id and name were both being passed, however only name was kept and id was discarded.
codenamezero
Posts: 22
Joined: Thu Dec 19, 2019 7:23 pm

Re: Unable to set 'id' on column chart series?

It turns out, I could access it via `chartObject.series[0].options.id`. >.<
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Unable to set 'id' on column chart series?

Hello codenamezero!

We appreciate you reaching out to us!

That's right, congrats on finding the solution.

Feel free to ask any further questions!
Best regards!
Dominik Chudy
Highcharts Developer

Return to “Highcharts Usage”