Winforms图表,反转时如何在列外设置标签位置

时间:2020-01-13 12:39:29

标签: c# winforms charts column-chart

我正在尝试生成报告并在Windows窗体应用程序中使用System.Windows.Forms.DataVisualization.Charting.Chart显示报告。

AxisY反转时,标签与列重叠。

有人可以帮我反转后如何在列外设置标签位置吗?

Chart_out.ChartAreas[0].AxisX.LabelStyle.TruncatedLabels = false; //SetCustomProperty("BarLabelStyle", "Outside");
//Chart_out.Axisx().labels().position("inside");

Chart_out.ChartAreas[0].AxisX.Interval = 1;
Chart_out.ChartAreas[0].AxisX.MajorGrid.LineWidth = 0;
Chart_out.ChartAreas[0].AxisY.MajorGrid.LineWidth = 0;
Chart_out.Series[0].Color = Color.Red;
chart_in.ChartAreas[0].IsSameFontSizeForAllAxes = true;
Chart_out.Series[0].SmartLabelStyle.Enabled = false;
Chart_out.ChartAreas[0].AxisX.LabelStyle.Angle = 45;
//Chart_out.ChartAreas[0].AxisX.LabelStyle.Font = new System.Drawing.Font("Microsoft YaHei UI", 11F, System.Drawing.FontStyle.Bold);
Chart_out.ChartAreas[0].AxisX.LabelStyle.Font = new System.Drawing.Font("Microsoft YaHei UI", 10 F, System.Drawing.FontStyle.Bold);
Chart_out.Series[0].Label = "#VALY";

//Chart_out.Series["Series1"].SmartLabels.Enabled = true;
// Chart_out.Series[0].LabelAngle = 45;
Chart_out.ChartAreas[0].AxisX.PositionToValue(100);
Chart_out.ChartAreas[0].AxisY.IsReversed = true;
Chart_out.Series[0].Points.DataBindXY(X_out, Y_out);
Chart_out.ChartAreas[0].BackImage = "bbs.jpg";

enter image description here

0 个答案:

没有答案