Chart Direction

  

How to change the direction of the bar chart in Outsystems? So that in languages like Arabic it will appear from right to left.

Hi Mariam,

Welcome to the forum! OutSystems uses the Highcharts chart package. The Highcharts documentation explicitly mentions RTL languages here. The solution seems to be to set the Y-axis "opposite" flag and the X-axis "reversed" flag. You can use the YAxisFormat and XAxisFormat properties of the chart to set these.

Can you show me please how to exactly set these values?

Hi Mariam,

Did you try yourself first? If so, what exactly have you tried? Remember, we are here to help you, but not to do your homework ;).

Hello,

Yes I tried it, and nothing has happened. I would not have asked without trying.





Solution

Hi Mariam,

That's commendable, but still, you didn't tell us what you tried. In my first reply, I mentioned XAxisFormat and YAxisFormat, but that was a mistake: I actually meant the XAxisJSON and YAxisJSON parameter of the AdvancedFormat_Init function. In the XAxisFormat and YAxisFormat, there's no place to put the opposite and reversed flags I linked too, so if you actually tried to do what I said, I would expect a response of "where should I put the stuff, because I can't find the right place" instead of "can you show me how to do it".

That said, put the following in the AdvancedFormat parameter of your chart:

AdvancedFormat_Init(DataPointFormats:,DataSeriesFormats:,XAxisJSON:"reversed:true",YAxisJSON:"opposite:true",HighchartsJSON:"legend:{rtl:true, reversed:true}")

That will reverse the X-axis, put the Y-axis on the right side, puts the legend colour on the righ side, and reverses the order of the legends (I'm not entirely sure whether "reversed:true" is needed when "rtl" is true, you'll have to try out).

Solution