简体   繁体   中英

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

I make ac#

Bnnn

chart program. And, I use the MSChart.

I setup the Scrollbar information on ChartArea Collection.

When execute my program, the scrollbar is not visible... what's wrong with my ChartArea Collection.

And, I try to coding for setting scrollbar like this.

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

Is it any wrong?.

You are setting some properties on the AxisX scroll bar twice (such as Size and Enabled), but you are not setting them for the AxisY.

I suspect that you did a cut and past and forgot to change some X to Y ....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM