How to set same scale of X axis in two BarCharts

How to set same scale of X axis in two BarCharts

  

Hi,
 There are two BarCharts on a view.
 The BarCharts have different data however I want to be the same scale of X axis.
 Could you please help me out?
 Thank you.

Hi Chihiro,

The chart has a property called XAxisFormat. You can use that to format the X axis using the action XAxisFormat_Init in the Preparation to help you.

Cheers,

José

Solution

Hi Chihiro,

You mean, you need to define the max value of X to be the same on both charts?
If it is so, use the create a local variable of type AdvancedFormat, use it on both graphs (it has a property to assign)  and in the preparation set the XAxisJSON value of it to the max value you want:

"{ max:200 }"


Hope it helps.

Cheers,
Eduardo Jauch

P.S. Or you can use José's answer that should be more straightforward. :)

Solution

Thank you for your quick reply.

I tried to set the XAxisJSON max value as Eduardo's answer.

As a result, the problem has been resolved. 

Thank you.