I created the simple application. It creates collection of some objects and displays them using RadChart.
Here is the source code:
public partial class MainPage : UserControl
{
private ObservableCollection<ChartEntry> m_ChartEntries;
public MainPage()
{
InitializeComponent();
m_ChartEntries = new ObservableCollection<ChartEntry>();
for (int i = 0; i < 20; i++)
{
m_ChartEntries.Add(new ChartEntry { XValue = i, YValue = 10 });
m_ChartEntries.Add(new ChartEntry { XValue = i + 0.5, YValue = 20 });
}
radChart.ItemsSource = m_ChartEntries;
radChart.DefaultView.ChartArea.AxisX.AutoRange = false;
radChart.DefaultView.ChartArea.AxisX.MinValue = 1;
radChart.DefaultView.ChartArea.AxisX.MaxValue = m_ChartEntries.Count;
radChart.DefaultView.ChartArea.AxisX.Step = 1; // The Step is 1
}
}
The data are displayed correctly and Step is 1 (please note that AutoRange=false and Step is specified).
Afterwards I tried to add horizontal scroll bar. I added the next code:
radChart.DefaultView.ChartArea.ZoomScrollSettingsX.RangeStart = 0;
radChart.DefaultView.ChartArea.ZoomScrollSettingsX.RangeEnd = 0.25;
radChart.DefaultView.ChartArea.ZoomScrollSettingsX.ScrollMode = ScrollMode.ScrollOnly;
After adding scroll bar I have found the problem - now the data are displayed with the step 0.5 (please see the attached file). Why? How to solve this problem?
Many thanks.