ipsapps
Posts: 15
Joined: Tue Jul 16, 2024 12:51 pm

Xaxis Data Connectors+ Column Assignments

I am working on connecting my dashboards to multiple end points and am successfully getting the column assignments to work for the series, but I want the xaxis to be linked to a column from the source as well, instead of writing out each of the data categories. The reason for this is when i implement a drilldown- the xaxis will flip to another field and I want that to carry over.

Is there a way to do this with the connector/column assignment? Thinking that I telling it which column is the "category" and it uses the unique values from that field. Also trying to avoid renaming the field in the end point return "category" to just use "categories"

This is the fiddle example i've been using to review the functionality:

https://jsfiddle.net/gh/get/library/pur ... nt-1d-data
User avatar
dawid.d
Site Moderator
Posts: 1122
Joined: Thu Oct 06, 2022 11:31 am

Re: Xaxis Data Connectors+ Column Assignments

Hi,

Thanks for the question!

You can use the columnAssignment option not only to create one-dimensional data arrays but also for two-dimensional data arrays and with keys. Below is an example where I assigned the 'Categories' column as the first element of the two-dimensional data array (x-axis), and the 'First Column' and 'Second Column' as the second element for two separate series:

Demo: https://jsfiddle.net/BlackLabel/73enhpr1/

This approach allows you to dynamically assign columns from your data to series without manually defining each value. Check the demo below to see how it works in practice.

Best regards
Dawid Draguła
Highcharts Developer
ipsapps
Posts: 15
Joined: Tue Jul 16, 2024 12:51 pm

Re: Xaxis Data Connectors+ Column Assignments

This is perfect. exactly what i needed!
i am challenged thought with adding a drilldown for each of the series. If each of the series needs a separate drilldown id. Do you have an example of how that would work with the x axis?
We would need the drilldown to actually have a different value for the x axis. is that possible in this scenario?
User avatar
dawid.d
Site Moderator
Posts: 1122
Joined: Thu Oct 06, 2022 11:31 am

Re: Xaxis Data Connectors+ Column Assignments

Hi,

yes, you can specify the drilldown param from another column, see the demo below.

Demo: https://jsfiddle.net/BlackLabel/z80e4hsc/

Best regards
Dawid Draguła
Highcharts Developer
ipsapps
Posts: 15
Joined: Tue Jul 16, 2024 12:51 pm

Re: Xaxis Data Connectors+ Column Assignments

OK this is perfect.
The last question I have is what is best practice for the following:

2 series chart where the drilldown values will be different depending on the point selected for drilldown, as it will drill down to different series of data.
The data is coming from teh same source/connector - is there a way to utilize columnAssignment to reference the same connector but with nested subarrays?

in this case - would you split the series into separator connectors?

https://jsfiddle.net/jmac88/egtn8m2q/
ipsapps
Posts: 15
Joined: Tue Jul 16, 2024 12:51 pm

Re: Xaxis Data Connectors+ Column Assignments

Apologies - updating with a more representative fiddle of what i'm trying to do:

https://jsfiddle.net/jmac88/egtn8m2q/4/
ipsapps
Posts: 15
Joined: Tue Jul 16, 2024 12:51 pm

Re: Xaxis Data Connectors+ Column Assignments

I have gone the route of splitting it into different data connectors, as I couldn't find any reference material that would show multiple sources to the same connector. but the last issue that I have is how to reference drilldown data to a connector:

https://jsfiddle.net/jmac88/egtn8m2q/26/

If i add it right to the column assignment to be referenced, it will add it to the chart, even if i didn't define it in the series of the chart:

https://jsfiddle.net/jmac88/egtn8m2q/29/

Is there a way to do this with a data connector?
User avatar
dawid.d
Site Moderator
Posts: 1122
Joined: Thu Oct 06, 2022 11:31 am

Re: Xaxis Data Connectors+ Column Assignments

Hi,

Column assignment works exclusively for the main series, so it's possible to use multiple data sources, but it is to be used for passing data to the visible series in the root. (see: https://www.highcharts.com/docs/dashboa ... connectors)

In the demo below, I’ve presented one of the many ways to define data for drilldown, in this case within the same connector.

Demo: https://jsfiddle.net/BlackLabel/3oe8xpwz/

If you'd like the Dashboards Dev team to spend more time refining a custom solution that supports drilldown in Highcharts Components and have specific ideas or use cases, you can describe them as a feature request here: https://github.com/highcharts/highchart ... new/choose

Best regards
Dawid Draguła
Highcharts Developer

Return to “Highcharts Dashboards”