Sort highcharts bar graph with two series

Hello

We are trying to use a highcharts bar chart with two data series, one for others and one for myself. 

The two data series display separately, but I would like the one series (withonly one 'bar') to display within the other series in the correct order.

In other words, although I have two series I would like to sort them as if they are one series.

In this image you can see that the purple data series is at the top. I would like it to display in order.

Is this possible or should I be using a single series?

TIA for any help!

Solution

Hi Mitchell!

One approach would be you could set it in a single series and then set the color of that bar to purple if it meets a certain condition, e.g. GetUserId() = UserId, using additional Attributes in the Aggregate that table is using. You can add the new attributes in the Aggregate by right-clicking on one of the column names of the Aggregate and then placing the condition there.

Kind regards,

Joseph Enriquez

Solution

Hi Joseph

Thanks for your quick response! We happened to go down exactly the same road there.


Do you perhaps know if there would still be a way to have a legend for the two colours? 



Mitchell Terblanche wrote:

Hi Joseph

Thanks for your quick response! We happened to go down exactly the same road there.


Do you perhaps know if there would still be a way to have a legend for the two colours? 



I was able to assemble a quick example (BarChartTest.oml with ChartTest as app name) with Id 10 in a different color. Note that I changed the color of Id 10 in the Colors property using an If() under the Mapping to Datapoint in the Bar Chart Widget that I used. The other bars are colored black. The Legend reflects the same colors.


Thanks Joseph!

Unfortunately we are using the advanced JSON so I dont think this will help us.

This is not a critical item for us but we will investigate a way to perhaps 'spoof' the legend if it is requested.

Thanks again for your help!