pranav2701
Posts: 8
Joined: Thu Sep 21, 2023 8:57 am

Plotting multiple different plots using same container and different data,

Thu Sep 21, 2023 9:03 am

I have an xrange graph and i want to plot a lengend on top what each color signifies in the same line. The xrange graph should be below the said legend.
The legend has 4 values (eg. val1,val2,val3,val4 ).
So the structure must be something like this:
# val1 # val2 # val3 # val4
[


X range graph


].


# denotes colored circles, diff for each val.
[ ] denotes the xrange graph.

pranav2701
Posts: 8
Joined: Thu Sep 21, 2023 8:57 am

Re: Plotting multiple different plots using same container and different data,

Thu Sep 21, 2023 10:15 am

Update, The x-axis of the x range graph is on top. So the legend must be above that. functions() cant be used. Am currently trying to create legend with a bubble chart and a heat map.

jakub.j
Posts: 857
Joined: Tue Jan 24, 2023 11:14 am

Re: Plotting multiple different plots using same container and different data,

Fri Sep 22, 2023 6:45 am

Welcome to our forum and thanks for contacting us with your question!

Could you please visualize what exactly do you want to achieve? I can't understand what do you mean.

Also, please send a live demo of your chart or anything that you have already done so that I will be able to work on your example.

Best regards
Jakub
Jakub
Highcharts Developer

pranav2701
Posts: 8
Joined: Thu Sep 21, 2023 8:57 am

Re: Plotting multiple different plots using same container and different data,

Fri Sep 22, 2023 7:55 pm

https://jsfiddle.net/trmxg258/1/

Something like this just that the legend isn't related to the x range graph. More like a dummy legend with color set with hex and the values to display. Hope this helps.

jakub.j
Posts: 857
Joined: Tue Jan 24, 2023 11:14 am

Re: Plotting multiple different plots using same container and different data,

Mon Sep 25, 2023 7:03 am

Hey!

Thanks for explaining it!
To achieve the result that you wanted, I had to split your data into seperate series by the y value. Than, I extended the legend prototype because x-range series does not handle series.color property. Now the legend is shown correcly for each series with a corresponding color.

Demo: https://jsfiddle.net/BlackLabel/9276a405/

Let me know if that is what you were looking for!
Best regards
Jakub
Jakub
Highcharts Developer


Return to “Highcharts Usage”