I’m using MSChart and I want to enable zoom on the X Axis and once this is zoomed I want the Y Axis to auto zoom into a range appropriate for the data viewable.
Any assistance with the problem would be greatly appreciated!
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The kind of zooming that you want to do cannot be automatically accomplished by MSChart. Once you have retrieved the ‘Zoom-In’ X-value range from the user, you need to write a little more code to reset the Y-axis scaling appropriately.
This works most easily if you are using a Line style of data series and your source data for that series is stored as a SortedList.
Once you have used something like the code above to get your minY and maxY, you can then use those values to reset the min and max Y-axis values on the ChartArea: