hi all, I’m using SciChart with MVVM light.
I am working on a stock chart OHLC and data are coming in from Mintpal.
Mintpal has an API where you can request a specific date range: 6 hours, 24 hours, 1 week, etc.
Running the application requests for 6 hours OHLC data, and on the application, I can select 24 hours, 3 days, 1 week
my problem is, how do you automatically adjust the zoom level without double clicking the cart?
Autorange is set by the way on YAxisStyle
To know about my problem, here’s a sample video using the test app I made.
- jaysonragasa asked 10 years ago
- last edited 10 years ago
- You must login to post comments
You can try with for example this line of code:
YAxis.VisibleRange = RangeFactory.NewWithMinMax(this.YAxis.VisibleRange, yaxisminimRange, yaxismaximumRange);
You can also look at the examples with ViewportManager. However i think the line above is what you need. Of course this is for the Y axis but you can do the same for the X Axis. Just make sure to use the correct format.
Here is a good example with the ViewportManager: Zoom Including Annotations
- bochelie answered 10 years ago
- last edited 10 years ago
-
I am using MVVM light.. I am not really sure how to implement that on the code behind of the Window. But I'll see what I can do. Can I ask, how do you enumerate child charts on a chart group? Thanks
-
hi, you could bind the ViewportManager to your ViewModel, please, take a look at the Drag Horizontal Threshold example
-
And another ViewportManager example in your other question on ZoomExtents of charts in a SciChartGroup. This is the way to directly control the chart from a ViewModel. Thanks everyone who posted!
-
I found another way which works as well <s:SciStockChart.XAxisStyle><Style TargetType="s:CategoryDateTimeAxis"><Setter Property="AutoRange" Value="Always"/></Style></s:SciStockChart.XAxisStyle>
-
Awesome, thanks for sharing! You can create your own answer and we can vote for it if you want
- You must login to post comments
Please login first to submit.