【问题标题】:How to displace the origin of the Y axis on a polar Mschart?如何在极坐标 Mchart 上移动 Y 轴的原点?
【发布时间】:2012-06-18 13:25:10
【问题描述】:

我正在使用 mschart 制作一个极坐标图,我需要在图表中间制作这个“洞”。我的意思是,我需要 Y 轴的“0”不在中心。我在stackoverflow的某个地方看到了这个情节。这正是我需要的,我该怎么做?

【问题讨论】:

    标签: c# visual-studio-2010 mschart


    【解决方案1】:

    为了创建一个看起来像提供的示例的雷达图

    // disable grid a long X
    chart1.ChartAreas[0].AxisX.MajorGrid.Enabled = false;
    chart1.ChartAreas[0].AxisX.MajorTickMark.Enabled = false;
    
    // set Y axis
    chart1.ChartAreas[0].AxisY.Minimum = -20;  // creates the 'hole' by setting min Y
    chart1.ChartAreas[0].AxisY.MajorGrid.IntervalOffset = 20; // so the major grid does not fill the 'hole'
    chart1.ChartAreas[0].AxisY.MajorGrid.Interval = 5;
    chart1.ChartAreas[0].AxisY.MajorGrid.LineDashStyle = ChartDashStyle.Dash;
    

    【讨论】:

    • 非常感谢。你知道他是如何设法使刻度线与区间匹配,并在那个位置从 0 开始的吗?
    • 将AxisY.MajorTickMark 设置为与AxisY.MajorGrid 相同,以获得匹配的报价。
    猜你喜欢
    • 2018-09-23
    • 1970-01-01
    • 1970-01-01
    • 2016-07-29
    • 2016-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多