简体   繁体   中英

How can I set different scales for different series in C# chart control?

What I want to accomplish is shown in the image below. In that chart, I have three series, with the scales for each of them shown on the left side (maximum on the top, minimum on the bottom.)

In the chart control, as far as I know, what I can do is set the properties Chart.ChartArea[0].AxisY.Minimum and Chart.ChartArea[0].AxisY.Maximum , but they are common to all series.

Is there any way that allows me to set different Minimum and Maximum values for each series, thus allowing me to have different scales for each of them?

不同比例显示的不同系列

You may want to have a look on the "MultipleYAxis" sample of the "Samples for Chart Control" that can be downloaded here .

The idea is to use two ChartArea per serie in the same chart control. Both contains the exact copy of each other points serie.

  • The first one is aligned to left and shows only the Y Axis without the points
  • the seconds comes immediately to the right and shows only the points without the Y Axis.

Because you are using three series, you will have to use six ChartAreas.

It sounds a bit cumbersome and it requires some work to implement, but I did it in one of my project a dynamic way. It works very well and there is not that much performances penalty.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM