【问题标题】:MSChart Doesn't Fill Entire Chart AreaMSChart 未填满整个图表区域
【发布时间】:2014-01-11 22:48:58
【问题描述】:

MSChart 没有填满整个图表区域,我尝试使用示例 (Why Doesn't MSChart Fill Entire Chart Area?) 但它不起作用

我正在使用下面的代码

  volumeChart.ChartAreas["ChartArea1"].AxisX.Interval = 1;// a cada 1 coluna 1 label
            volumeChart.ChartAreas["ChartArea1"].AxisX.LabelStyle.Angle = 45;// Angulo do label
            volumeChart.ChartAreas["ChartArea1"].AxisX.LabelStyle.Font = new Font("Tahoma", 8F);
            volumeChart.ChartAreas[0].AxisY.Title = Environment.NewLine + "Qtde";
            volumeChart.ChartAreas[0].AxisX.Title = Environment.NewLine + "Semana / Mês";
            volumeChart.ChartAreas[0].AxisX.MajorGrid.LineWidth = 0;
            volumeChart.ChartAreas[0].AxisY.MajorGrid.LineWidth = 0;

https://dl.dropboxusercontent.com/u/19875180/Chart_Fill.png

【问题讨论】:

    标签: c# winforms mschart


    【解决方案1】:

    您真的应该尝试更改 InnerPlotPosition 值。

    // Change to a bigger value if your x and y axis labels are not shown anymore
    volumeChart.ChartAreas[0].InnerPlotPosition.X = 0;
    volumeChart.ChartAreas[0].InnerPlotPosition.Y = 0;
    
    // Height and width are in percentage (%)
    volumeChart.ChartAreas[0].InnerPlotPosition.Height = 100;
    volumeChart.ChartAreas[0].InnerPlotPosition.Width = 100;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-09-07
      • 1970-01-01
      • 1970-01-01
      • 2017-01-30
      • 1970-01-01
      • 2022-12-10
      相关资源
      最近更新 更多