如何在c#中绘制包含主轴和辅助轴的图表

时间:2012-04-08 06:21:10

标签: c# visual-studio visual-studio-2010 mschart

我想绘制一个包含主Y轴和辅助Y轴以及公共X轴的mschart。这是可能的重复,但我没有找到我正在寻找的解释:

Charts multi type and secondary Y axis

MS Chart Control Two Y Axis

我需要一些关于如何使用MSChart

绘制此类图表的帮助

2 个答案:

答案 0 :(得分:0)

ChartArea chartarea = new ChartArea();

Series Memory = new Series();

RepeatsMemoryPlot.Series.Add(Memory);

//Add points to series Memory

Memory.Points.AddXY(a, b);

Series Time = new Series();

RepeatsMemoryPlot.Series.Add(Time);

Time.ChartArea = Memory.ChartArea;

Time.YAxisType = AxisType.Secondary;


//Add Points to time series
Time.Points.AddXY(a, b);

答案 1 :(得分:0)

在ChartArea中,选择Axis,然后选择Secondary Y(值)轴 并将Enabled从Auto更改为True

第二个轴将显示