Bar chart - not displaying labels in the right order

Hello,

I have a bar chart with two data series.

The DataPointList that I use to feed the chart is ordered by month but when the chart is displayed it presents the labels ordered by the series 1, then the series 2 and if there's a month with no data, that month is displayed in the end.

I am sure that the list is ordered by month, the problem is when it is displayed on the chart.

What can I do? Is this a highcharts bug?


Thanks,

Filipa

Filipa Carrelo wrote:

Hello,

I have a bar chart with two data series.

The DataPointList that I use to feed the chart is ordered by month but when the chart is displayed it presents the labels ordered by the series 1, then the series 2 and if there's a month with no data, that month is displayed in the end.

I am sure that the list is ordered by month, the problem is when it is displayed on the chart.

What can I do? Is this a highcharts bug?


Thanks,

Filipa

Hello Filipa,

Can you please share the oml?

KR,

Ruben Bonito


Solution

both datasets need to be same size, same order.

so if you are missing data, it has to be filled with 0, otherwise you are going to misaling


Solution

J. wrote:

both datasets need to be same size, same order.

so if you are missing data, it has to be filled with 0, otherwise you are going to misaling


I filled it with 0.


Hi Filipa,

Can you send the oml or a print screen of the query and another one of the logic?

Solved with a work around.

Added first a dummy series, with transparent color, for the 12 months. So now is always displayng the 12 labels.

Thanks for the replies

Almost same problem:

column chart. query retrieves values ordered by period (year-month).

if i display stacked columns ordered is changed:

Hi @Emanuele Mattei, 


Did you solve this issue? If yes, how?


Regards,

No,

I didn't. And I got no support from forum.

Thinking about opening a support request...

Emanuele Mattei wrote:

No,

I didn't. And I got no support from forum.

Thinking about opening a support request...

it is generally better to create a separate support thread for an issue...

Are you passing in a list from an aggregate or a list of custom structure?


I'm passing a list from an aggregate. I sort the result in aggregate and they are append to a List.

Thanks, I will try to recreate.

Question: Can you share the "destination" list that you use in the list append action and the data type of that list?

This is the destination List and the debug result before chart refresh:

Hi NB,

Can you add an image of the resulting chart?

Well, the good news is I could reproduce it using your data above, the bad news is I don't know how to solve this. It seems OutSystems sorts the data according to the Label names, putting Labels with more data points first.

Yes... I suppose it's a bug/feature that has to be fixed in the charts component.

Anyway it's absolutely critical (at least for us): we can't deliver an application that is compliant with customer's requirements. The customer wants to see ordered data and we simply can't explain that it is actually impossible to do. It sounds crazy for him!

Any workaround is also welcome. A fix would be better!

As a workaround, via the AdvanceFormat parameter of the Chart, HighchartsJSON Attribute, you can put any JSON that HighCharts accepts, including actual chart values.

Thank you all. I will have to learn JSON :)

Regards

Hey Emanuele,


I think maybe your problem is solved by the same remark as J. made earlier for the problem of Filipa, as in, certain combinations of date + status are missing from your list.  Have you tried adding them with a value of 0 ?

so for example:

  • Label : "01/01"
  • Value : 0
  • DataSeriesName : ToAnalyze

should be in your datapoint list, even if for that day for that status, none are found in the database.

These will not show up in the chart, but will make your list of datapoints 'complete' (for lack of a better word)

Inspired by your problem, I created attached oml (different datamodel, same type of chart) and found that as soon as I based my list of datapoints on the carthesian product of stocks times ratings instead of on the Aggregate retrieving the actual ratings given for stocks, I was able to sort the labels and the dataseries whatever way I wanted by adjusting the order I added them to the datapoint list.


Can be tested at https://dorineboudry.outsystemscloud.com/ChartDemo/


Good luck,

Dorine

Thanks,

I'm going to try it as soon as possible

Problem solved. I had create 2 Server Action, one to initialize List for each Label every DataSerieName with Value 0 and other to update with the values that came from my Aggregate. 

Hi NB,

Thanks for reporting back, and great that this solution worked for you. Happy coding!