[英]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. 据我所知,在图表控件中,我可以做的是设置属性
Chart.ChartArea[0].AxisY.Minimum
和Chart.ChartArea[0].AxisY.Maximum
,但是它们对于所有系列都是通用的。
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 . 您可能想看看“图表控件的样本”的“ MultipleYAxis”样本,可以在此处下载。
The idea is to use two ChartArea per serie in the same chart control. 这个想法是在同一个图表控件中每个系列使用两个ChartArea。 Both contains the exact copy of each other points serie.
两者都包含彼此积分的精确副本。
Because you are using three series, you will have to use six ChartAreas. 因为您使用的是三个系列,所以必须使用六个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.
它工作得很好,并且没有太多的性能损失。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.