Hi, I have a chart with a HorizontalZoombar. Currently when it draws, the scroll bar is set to the far right (last item on the timeline) and the user has to scroll to the left to view the first chart entries. I would like it to default to the exact opposite - scroll defaults to the left and user needs to scroll right to view latest entries.
I have tried setting WindowPositionHorizontal but it has no effect.
Cheers
Peter
Hello Peter,
I have been investigating into the behavior you are seeing and I am curious what you are currently setting to have the scroll-bar set to the far-right. Normally, the WindowPositionHorizontal should work in this case as long as you are also setting the WindowScaleHorizontal, but I am under the impression that you may be setting the WindowRect at another point, as this is what the XamDataChart’s HorizontalScrollbar tied to.
Can you please confirm whether or not you are using the WindowRect or perhaps setting the XamDataChart’s viewport in another way?
Please let me know if you have any other questions or concerns on this matter.
As a follow-up to this, if you want to set the zoombar to be on the left-side, you can set the WindowPositionHorizontal to 0 and set the WindowScaleHorizontal to a value greater than 0 but less than 1. For example, if you set the WindowScaleHorizontal to 0.25, you would see 1/4 of the plot area.
Hi, setting WindowPositionHorizontal="0" (or anything else for that matter) has no effect.
This reply fails whenever I attach an image or file. My source code is on my OneDrive here.
1drv.ms/.../s!AoTSoVtqxDS6pMln9J-6h-X-ME1RTw
I was unfortunately unable to run the sample you provided due to missing dependencies that I am guessing are likely in the SCMLib assembly that is referenced in the project. From looking at it though, I am seeing some code that might conflict with your setting of WindowScaleHorizontal and WindowPositionHorizontal in the DataContextChanged event that you are handling. I also cannot tell what “Scale” is returning in your binding to WindowScaleHorizontal.
I have created a sample based on the one you provided to demonstrate that setting the WindowScaleHorizontal and WindowPositionHorizontal does work to set the zoombar position to the left side. I am attaching it here.
XamDataChartZoombarTest.zip