Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
See more:
Respected sir,

i have been using charting in my VB.NET windows application using DataVisualization..
i want to zoom this chart using specific keys on keyboard...
i am using following code..but i want vertical zooming too..and following code does not show the proper result..
VB
.ChartAreas(0).AxisX.ScaleView.Zoomable = True
.ChartAreas(0).AxisY.ScaleView.Zoomable = True

.ChartAreas(0).CursorX.AutoScroll = True
.ChartAreas(0).CursorY.AutoScroll = True


above code only does horizontal zooming not vertical zooming..

so please help me.

Thank you,
Posted
Updated 24-Jun-12 10:14am
v3
Comments
ZurdoDev 21-Jun-12 8:07am    
What does the code do? You say it does not show the proper result but what is it doing?
Sunil Bansode 21-Jun-12 14:28pm    
above code is only does horizontal zooming not vertical zooming..
and i want vertical zooming since some y-axis points are very small as compare to other point so i need to zoom vertical axis too..
[no name] 3-Jan-15 19:36pm    
Don't see a reason why this question should be popular. Sorry but a good zoom is that old than graphics is available....and don't tell me it has to be re-envented with .net

1 solution

This is what worked for me:

Chart1.ChartAreas(0).CursorX.IsUserSelectionEnabled = True Chart1.ChartAreas(0).CursorY.IsUserSelectionEnabled = True
Chart1.ChartAreas(0).AxisX.ScaleView.Zoomable = True
Chart1.ChartAreas(0).AxisY.ScaleView.Zoomable = True
Chart1.ChartAreas(0).CursorX.AutoScroll = True
Chart1.ChartAreas(0).CursorY.AutoScroll = True

The code apparently allowed to use a mouse to select a specific region of the graph and it zoomed into it on both axes.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900