简体   繁体   中英

How to get the AxisX interval MS Chart Control

I am trying to get AxisX interval for MS Chart Control in code behind. But when i try to retrieve the value, it returns zero even though it has a default value.

'Doesn't return the correct value, only returns 0
Dim XInterval As Double = mainChart.ChartAreas(0).AxisX.Interval
'  
'
'This allows me to set the value and works just fine, but I also need to get it first.
mainChart.ChartAreas(0).AxisX.Interval = 2000

According to the MSDN article on the Axis.Interval Property :

A double value that represents the interval of an axis. The default value is "Auto", which is represented by a value of zero (0).

So, i you're using the "default value" (auto), that would explain why you're getting a zero back.

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