Jhow
Jhow

Reputation: 43

MSChart Doesn't Fill Entire Chart Area

The MSChart does not fill entire Chart Area, I tried using the example ( Why Doesn't MSChart Fill Entire Chart Area?) but it did not work

I am using the code below

  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

Upvotes: 4

Views: 4444

Answers (1)

Stefan Orie
Stefan Orie

Reputation: 604

You should really try to change the InnerPlotPosition values.

// 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;

Upvotes: 7

Related Questions