2D zooming

2 posts, 0 answers
  1. Oriya eden
    Oriya eden avatar
    1 posts
    Member since:
    Aug 2009

    Posted 09 Aug 2009 Link to this post


    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

    code snippet:





    .mMyChart.RadChart1.DefaultSeriesDefinition = new SplineSeriesDefinition();




    <Data> listData = new List<Data>();
    (int i = 0; i < oc.OctaveNotes.Length; i++)  



    {    listData.Add(

    new Data(oc.OctaveNotes[i]));    }




    .mMyChart.RadChart1.ItemsSource = listData;








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




        Int32 Step = this.mMyChart.RadChart1.DefaultView.ChartArea.AxisX.TicksDistance; 

        Step = Step / 5 * 4; 


        this.mMyChart.RadChart1.DefaultView.ChartArea.AxisX.TicksDistance = Step;  


    .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; } 




    Data(NoteInOctave note)  





            mX = note.NoteDateTime; 


            Double.TryParse(note.MesuredValue, out mY);  







  2. Vladimir Milev
    Vladimir Milev avatar
    1061 posts

    Posted 13 Aug 2009 Link to this post

    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.
Back to Top