views:

23

answers:

1

Hello.

I've got a bar's graphic in a chart control in my app. I've set the properties as this code shows:

Chart1.ChartAreas("ChartArea1").AxisX.ScrollBar.Enabled = True
Chart1.ChartAreas("ChartArea1").AxisX.IsLabelAutoFit = True
Chart1.ChartAreas("ChartArea1").AxisX.ScaleView.Size = 40

I did that becaus I wanted to fix the columns width so that 40 columns can be seen. Then (over the 40 first cols) a scroll is automatically shown.

I want to know how can I do to make that scroll be always on the right. So that the visible columns be always the last 40.

Thanks!

Diego

Edit

I copied the code above from here: http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/40a9646a-fbf1-47d1-85e4-47bc9108a3eb

A: 

I've found out: each time I add a new point I must run this code:

if (chrGraficos.ChartAreas[0].AxisX.Maximum > chrGraficos.ChartAreas[0].AxisX.ScaleView.Size)
    chrGraficos.ChartAreas[0].AxisX.ScaleView.Scroll(chrGraficos.ChartAreas[0].AxisX.Maximum);
Diego