【问题标题】:How to plot a chart with both primary and secondary axis in c#如何在c#中绘制具有主轴和次轴的图表
【发布时间】:2012-04-08 06:21:10
【问题描述】:

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

Charts multi type and secondary Y axis

MS Chart Control Two Y Axis

我需要一些关于如何使用MSChart 绘制此类图表的帮助

【问题讨论】:

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


    【解决方案1】:
    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);
    

    【讨论】:

      【解决方案2】:

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

      第二个轴将显示

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-12-02
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-10-04
        • 1970-01-01
        相关资源
        最近更新 更多