I have a requirement in which I need to change X or Y axis range dynamically. User provides minimum value, maximum value and an increment value. He can undo and can go back to original auto scaling mode also.
Questions
1) SetRange is working if I just want to change min and max values. How can I specify increment value?
2) Should I use custom axis ticks?
3) Should I call refresh code to repaint with new values at any time?
Thanks
Change X or Y Axis Range
Moderator: Queue Moderators
Re: Change X or Y Axis Range
1) There's no increment value available. You can however play with axis' AutoDivSpacing, AutoDivSepearationPercent, Major/MinorDiv and Major/MinorDivCount properties but...
2) ... I think you may want to use custom axis ticks if you want to use exactly the same tick count as the increment value.
3) Um, not sure what you mean... Just set the properties between BeginUpdate and EndUpdate method calls and you should be fine. Chart updates itself on each property change so use those two methods if you set two ore more properties to avoid unnecessary rendering cycles.
Try the properties I mentioned with our WinForms demo application. Just select an example, go to Properties tab page and use the property grid to see how changing those properties make chart look. Very good tool to see instantly how different property values change the look of chart.
2) ... I think you may want to use custom axis ticks if you want to use exactly the same tick count as the increment value.
3) Um, not sure what you mean... Just set the properties between BeginUpdate and EndUpdate method calls and you should be fine. Chart updates itself on each property change so use those two methods if you set two ore more properties to avoid unnecessary rendering cycles.
Try the properties I mentioned with our WinForms demo application. Just select an example, go to Properties tab page and use the property grid to see how changing those properties make chart look. Very good tool to see instantly how different property values change the look of chart.