Hello,
is it possible to use the build in zoombar just as scrollbar? In order the user can just scroll, but not allowed to zoom. I recognized that when I have a lot of data to display, the chart becomes slow. Therefore, when I only show a part of the whole chart (history data) the chart remains fast.
I know I can use the standard scrollbar, but it doesn't fit so well into the chart.
It would be nice, when the property XamDataChart.HorizontalZoomable is set to FALSE and HorizontalZoombarVisibility is set to TRUE, that only scrolling would be enabled.
Hi Bin,
I’m glad I was able to help resolve your issue, if you have any further questions that I can assist you with, please let me know.
Warm regards,
Chris K.
The specific approach for scrolling the XamDataChart’s content using its default ZoomBar, while HorizontalZooming is set to false, is not currently supported, but the general behavior that you are interested in is certainly possible using an alternate approach.
The reason that specific approach is not currently supported is that setting the XamDataChart’s HorizontalZoomable property to false will override any of the associated zoom events which would have been triggered by either mouse wheel interactions on the chart or by interactions made on the chart’s Zoombar component, as both scale and drag manipulations on the Zoombar’s thumb component are considered zoom behaviors.
To achieve the general behavior of scrolling via the Zoombar, (this approach is applicable to both the internal and external Zoombar controls) while excluding any interactions that may result in an actual zooming of the chart’s content, one possible approach could include:
1. Handle the PreviewMouseWheel event on the chart, (to ignore mousewheel zooming)
2. Re-use and modify the Zoombar’s HorizontalScaleLeft and HorizontalScaleRight styles, hooking into the ZoombarScale’s MouseDown event and handling them for both, (to ignore attempted modifications to the Zoombar’s scaling thumb via mouse interactions)
3. Setting HorizontalZoomable to ‘true’ on the chart
I’ve constructed and attached a sample to demonstrate this approach for a more complete context to demonstrate this behavior.
If you have any further questions that I may assist you with, please let me know.