Hi,
This is a part of my code where my chart is populated by the a list(myList). I want to see only 12 bars in my chart, so when the list goes over 12 items,the user needs to use the scroll to see the rest of the bars. This code is executed on "onclick" of a button,
-when it is first clicked and the list has more than 12 items, everything works as expected.
-when it is clicked a second time and the list has less than 12 items, I do see the correct bars but I see the scrollAndZoom where I have put "zoomSettings.ScrollMode = ScrollMode.None;
"
-on a third click when the list has more than 12 items, I see the scrollbar, but I can not go to then next 12 items....Any help?
if (mytList.Count > 12)
{
ZoomScrollSettings zoomSettings = new ZoomScrollSettings();
zoomSettings.RangeEnd = (12d / myList.Count);
zoomSettings.RangeStart = 0;
zoomSettings.ScrollMode = ScrollMode.ScrollAndZoom;
myCostChart.DefaultView.ChartArea.ZoomScrollSettingsX = null;
myCostChart.DefaultView.ChartArea.ZoomScrollSettingsX =zoomSettings;
}
else
{
ZoomScrollSettings zoomSettings = new ZoomScrollSettings();
zoomSettings.ScrollMode = ScrollMode.None;
zoomSettings.SetSelectionRange(0, 1);
myCostChart.DefaultView.ChartArea.ZoomScrollSettingsX = null;
myCostChart.DefaultView.ChartArea.ZoomScrollSettingsX = zoomSettings;
}
myCostChart.ItemsSource = myList;