Hi.
I'm using a trial version of RadControls for WPF.
I was looking for a way to dynamically "Zoom" in/out a 2D chart( both the x and y axises).
I tried to change TicksDistance value to achieve this goal, but no use.
I thought a refresh might be needed so I added a Dispatcher.Invoke call, and steel no use.
On the AxisY I tried all the above replacing TicksDistance of AxisX with Step property of AxisY.
No use.
If "zooming" is possible in a 2D (Spline series) what is the correct way achieving it?
Thank you
Uriya
code snippet:
this
.mMyChart.RadChart1.DefaultSeriesDefinition = new SplineSeriesDefinition();
List
<Data> listData = new List<Data>();
for (int i = 0; i < oc.OctaveNotes.Length; i++)
{ listData.Add(
new Data(oc.OctaveNotes[i])); }
this
.mMyChart.RadChart1.ItemsSource = listData;
if
(e.Delta > 0)//wheel up
{
Int32 Step = this.mMyChart.RadChart1.DefaultView.ChartArea.AxisX.TicksDistance;
Step = Step / 4 * 5;
this.mMyChart.RadChart1.DefaultView.ChartArea.AxisX.TicksDistance = Step;
}
else
{
Int32 Step = this.mMyChart.RadChart1.DefaultView.ChartArea.AxisX.TicksDistance;
Step = Step / 5 * 4;
this.mMyChart.RadChart1.DefaultView.ChartArea.AxisX.TicksDistance = Step;
}
this.mMyChart.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Render, mEmptyDelegate);
public class Data
{
private DateTime mX;
public DateTime X
{
get { return mX; }
set { mX = value; }
}
private Double mY;
public Double Y
{
get { return mY; }
set { mY = value; }
}
public
Data(NoteInOctave note)
{
mX = note.NoteDateTime;
Double.TryParse(note.MesuredValue, out mY);
}
}