生成多个y轴 [英] Generating multiple y-axis
问题描述
有谁知道如何显示多个y轴和y轴值(celcius和cm)的系列?我已经看过了ChartSamples中的示例,但我对这种方法并不太满意。
Does anybody know how to display multiple series with multiple y-axis and y-axis values (celcius and cm)? I've had a look at the example from the ChartSamples, but I'm not overly comfortable about this approach.
推荐答案
我同意具有多个图表区域的示例环境中的示例不是很方便。
I agree that the example in the samples environment with multiple chart areas is not very convenient.
但是,如果您只需要两个y轴,则可以启用辅助y轴
(Area.AxisY2。) 如果您希望其他系列使用该轴,请将Series.YAxisType设置为AxisType.Secondary。如果单个系列需要两个不同的刻度,请设置min& ;;辅助轴的最大值反映主
轴的变化。
However if you only need two y axis you could just enable the secondary y axis (Area.AxisY2.) If you want another series to use that axis, set the Series.YAxisType to AxisType.Secondary. If you need two different scales for a single series, set the min & max for the secondary axis to reflect the changes in the primary axis.
使用Area.RecalculateAxisScale让图表自动计算最小值和最小值。如果在运行之前需要值
(例如从主轴),则最大值。
Use the Area.RecalculateAxisScale to have the chart automatically calculate the min & max if you need the values (from the primary axis for example) before runtime.
如果你需要两个以上的y轴那么你'我必须尝试采样方法。
If you need more than two y axis then you'll have to try the samples approach.
这篇关于生成多个y轴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!