ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Show multiple chart together to view the trend
Posted by byuan on Dec-25-2019 09:56
Attachments:
Hi,

I would like to create a graph as attached. Multiple chart use same axis range, and show them together. Do you know how to write the code for this chart in java?

Thank you
trend.png

  Re: Show multiple chart together to view the trend
Posted by Peter Kwan on Dec-26-2019 04:04
Hi byuan,

Your chart can be considered as 10 charts packed together.

The simplest method is to write a subroutine to draw one chart with axis labels. You can then use a loop to generate 10 charts with different data. You can use a MultiChart object to combine the charts together with the charts partially overlapped. You can combine it so that the left y-axis of one chart is hidden under the plot area of the chart on its right side. In this way, only the leftmost chart will have a visible y-axis. Similarly, only the bottom row of charts have visible x-axis.

To ensure the charts have the same axis scale, there are several methods:

If the axis scale is specified by your code, you can use specify the same axis scale for all the charts. (It is quite common for the x-axis scale to be specified by code.)

If you would like the axis scale to be automatically determined, you may obtain the minimum and maximum data values for all your data, then use the same min/max values to specify the axis scale for all 10 charts. The code is like:

c.yAxis().setLinearScale(minValue, maxValue);

With the axis scale specified above, ChartDirector will auto-scale the axis based on the min and max value.

Hope this can help.

Regards
Peter Kwan

  Re: Show multiple chart together to view the trend
Posted by byuan on Dec-26-2019 09:04
Good idea, I will try it.

Thank you.
Da-long