1
votes

I have two line charts appearing on one page side-by-side in Flex. In each case the x-axis is a date time axis, the y-axis is whatever I get by default.

The maximum value shown on the y-axis of each chart (i.e. the y-axis scale) automatically adjusts itself according to the data on the chart. This is good, since I don't know what data will appear on each chart beforehand. However I would like the y-axis on both charts to be identical, matching the larger y-axis, so that they are easy to compare side-by-side. So for example:

  • Situation: Chart A has a maximum value of 120, chart B has a maximum value of 100
  • Currently: Chart A y-axis will go to 120, Chart B y-axis will go to 100.
  • Desired: Chart A y-axis goes to 120, chart B y-axis goes to 120.

How can I acheive this?

1

1 Answers

0
votes

You can set the minimum and maximum values on your Axis. Just set them both to 120. Would that do it?

            <mx:verticalAxis>
                <mx:LinearAxis id="yAxis" minimum="40" maximum="120"/>
            </mx:verticalAxis>

            <mx:horizontalAxis>
                <mx:CategoryAxis id="xAxis" minimum="40" maximum="120" /> 
            </mx:horizontalAxis>