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

Message ListMessage List     Post MessagePost Message

  mulitple y-axis/ 4 or 5 graphs on one charts
Posted by smr on Oct-27-2009 02:03
Attachments:
this is for a real time charting where we need to plot multiple graphs (y-axis) values will be different and for all of them x-axis values will be same.

I used the multiple y-axis sample given in the chartdir, but it seems to be confusing to the users.

I was wondering is there a way to plot them as if there are multiple graphs on single chart.

something similar to the attached image.

thanks a lot in advance,
x-multiple y axis.jpg

  Re: mulitple y-axis/ 4 or 5 graphs on one charts
Posted by Peter Kwan on Oct-27-2009 15:49
Hi smr,

There are two methods.

(a) If you are writing a desktop application, the easiest way is to simply create multiple charts (multiple XYChart objects, and multiple ChartViewer controls) and put them one on top of the other.

You can create the charts without the x-axis visible except the for the bottom chart, so the charts can be stacked top of each other with minimal gap. To create a chart without the x-axis visible, please set chart height and the plot area so that the bottom of the plot area is close to the bottom of the chart image. Also, use Axis.setColors to set the x-axis to transparent.

(b) For a web application, the method is similar to (a), that is, creating multiple XYChart objects. However, the HTTP standard requires one HTTP connections per image, so it is better to combine the multiple chart objects into a single image (using the MultiChart container), and output the combined image.

If you need further help, would you mind to inform me of your programming langauge and application type (desktop or web)?

Regards
Peter Kwan

  Re: mulitple y-axis/ 4 or 5 graphs on one charts
Posted by smr on Oct-27-2009 22:32
Thanks for the reply.

The application is web based and the programing language is JSP/Java on tomcat.

could you pl send me sample code for using the Multichart in JSP's.

thanks again for your help.

sm

  Re: mulitple y-axis/ 4 or 5 graphs on one charts
Posted by smr on Oct-28-2009 00:50
Iam all set with the sample code..

thanks for your help.

  Re: mulitple y-axis/ 4 or 5 graphs on one charts
Posted by Viks30 on Nov-28-2010 13:59
I have a similar request. I want to plot 3 y-axes.
I have made a graph that consists of 2 yaxis with a common X asis.

I figured I need to merge my 3rd X.Y image with the previous one to give a feel of 3 yaxis in one plot. Can you point me to any pseudo-code/sample code for the same (vb.net desktop appln).

-Thanks

  Re: mulitple y-axis/ 4 or 5 graphs on one charts
Posted by Peter Kwan on Nov-30-2010 01:03
Hi Viks30,

There is a sample code called "Multiple Axes" included in ChartDirector. It shows a chart with four y-axes and one x-axis, with all the data plotting in the same plot area.

The enquiry in this thread is for a different type of chart. It is for drawing multiple and separate XY charts and stack them one on top of the other.

If you would like to draw multiple XY charts, you can always do this in ChartDirector. You can then put all the charts in any place you like in your web page or user interface. In particular, you can put them one on top of the other.

In "pseudo-code", it is:

- draw first chart
- draw second chart
- draw third chart

In the VB.NET Windows Forms, the 3 WinChartViewers to show the 3 charts are laid out one on top of the other. So the charts will appear as stacked.

As mentioned earlier in this thread, if you want only the bottom chart to have x-axis labels, you can disable the x-axis labels in the other charts by setting the label color to transparent (use Axis.setColors), You can also create the charts so that the bottom of the plot area is close to the bottom of the chart image, so the charts can be stacked with minimal gap.

Hope this can help.

Regards
Peter Kwan