0
我有一個圖(見附圖),我想刪除端點「2060」和「2020」。我希望間距保持不變。但我想隱藏標籤2060和2020.有沒有一種方法可以通過編程實現MS Chart?去除MS圖中x軸的端點
代碼創建軸:
var area = new ChartArea();
chart.ChartAreas.Add(area);
chart.ChartAreas[0].Position.X = 5;
chart.ChartAreas[0].Position.Y = 10;
chart.ChartAreas[0].Position.Height = 80;
chart.ChartAreas[0].Position.Width = 80;
chart.ChartAreas[0].AxisX.LabelStyle.Font = font10Point;
chart.ChartAreas[0].AxisY.LabelStyle.Font = font10Point;
chart.ChartAreas[0].AxisX.Title = "Target Date Fund";
chart.ChartAreas[0].AxisY.Title = "% Up Capture";
chart.ChartAreas[0].AxisX.TitleFont = font10Point;
chart.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.Transparent;
chart.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.Black;
chart.ChartAreas[0].BorderColor = Color.Black;
chart.ChartAreas[0].Position = new ElementPosition(0, 10, 75, 85);
chart.Series[0].YAxisType = AxisType.Secondary;
chart.ChartAreas[0].AxisY.LabelStyle.Enabled = false;
chart.ChartAreas[0].AxisX.Crossing = 2060;
chart.ChartAreas[0].AxisX.IsReversed = true;
area.AxisX.Minimum = 2020;
area.AxisX.Maximum = 2060;
area.AxisX.Interval = 10;
area.AxisX.LineWidth = int.Parse("5");
area.AxisX.MajorTickMark.LineWidth = int.Parse("5");
area.AxisY.MajorTickMark.LineWidth = int.Parse("5");
area.AxisY.Minimum = area.AxisY2.Minimum = 0;
area.AxisY.Maximum = area.AxisY2.Maximum = 120;
area.AxisY.Interval = area.AxisY2.Interval = 20;
area.AxisY.LineWidth = int.Parse("5");
不要喲有一個代碼或東西嗎?請閱讀[faq]並[問] –
@SonerGönül吧!忘了補充:) – centarix