簡體   English   中英

為什么在MSChart的ChartArea中看不到滾動條?

[英]Why I can't see the Scrollbar in ChartArea of MSChart?

我做ac#

本恩

圖表程序。 而且,我使用MSChart。

我在ChartArea Collection上設置了滾動條信息。

執行我的程序時,滾動條不可見... ChartArea Collection有什么問題。

而且,我嘗試像這樣編碼來設置滾動條。

chart1.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = true;


chart1.ChartAreas[0].AxisX.ScrollBar.Size = 10;

 chart1.ChartAreas[0].AxisX.ScrollBar.Enabled = true;

 chart1.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = true;
 chart1.ChartAreas[0].AxisX.ScrollBar.Size = 10;
 chart1.ChartAreas[0].AxisX.ScrollBar.Enabled = true;

 chart1.ChartAreas[0].AxisX.ScrollBar.ButtonStyle =    ScrollBarButtonStyles.SmallScroll;

chart1.ChartAreas[0].AxisX.ScrollBar.BackColor = Color.LightGray;
chart1.ChartAreas[0].AxisX.ScrollBar.ButtonColor = Color.Gray;
chart1.ChartAreas[0].AxisX.ScrollBar.LineColor = Color.Black;

chart1.ChartAreas[0].AxisX.Minimum = 0;
chart1.ChartAreas[0].AxisX.Maximum = 10;
chart1.ChartAreas[0].AxisY.Minimum = 0;
chart1.ChartAreas[0].AxisY.Maximum = 100;
chart1.ChartAreas[0].AxisX.Interval = 1;

chart1.Series["Series1"].Points.AddXY(0, 0);
chart1.Series["Series2"].Points.AddXY(0, 0);
chart1.Series["Series3"].Points.AddXY(0, 0);

有什么不對嗎?

您在AxisX滾動條上兩次設置了某些屬性(例如Size和Enabled),但沒有為AxisY設置它們。

我懷疑您進行了剪切和過去操作,卻忘記了將X更改為Y ....

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM