This is a migrated thread and some comments may be shown as answers.

2D zooming

1 Answer 101 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Oriya eden
Top achievements
Rank 1
Oriya eden asked on 09 Aug 2009, 05:53 AM

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);  

    }

 

}

 

 

 

1 Answer, 1 is accepted

Sort by
0
Vladimir Milev
Telerik team
answered on 13 Aug 2009, 09:06 AM
Hi Oriya eden,

Unfortunately zooming they way you describe it requires data and UI virtualization in RadChart which is not yet available. These features are on our TODO list and will be implemented for one of the next releases.

All the best,
Vladimir Milev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Chart
Asked by
Oriya eden
Top achievements
Rank 1
Answers by
Vladimir Milev
Telerik team
Share this question
or