Zooming and Scrolling event

9 posts, 1 answers
  1. Chris Thierry
    Chris Thierry avatar
    138 posts
    Member since:
    Jun 2010

    Posted 02 Jul 2010 Link to this post

    Hi, is there any event that is executed when scrolling or zooming in a RadChart for Silverlight 4?
    Thank you.
  2. Vladimir Milev
    Admin
    Vladimir Milev avatar
    1061 posts

    Posted 07 Jul 2010 Link to this post

    Hello Chris Thierry,

    ChartArea.ZoomScrollSettingsX / ZoomScrollSettingsY are both implementing INotifyPropertyChanged, so you can handle the PropertyChanged event to do your stuff.

    Sincerely yours,
    Vladimir Milev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Chris Thierry
    Chris Thierry avatar
    138 posts
    Member since:
    Jun 2010

    Posted 08 Jul 2010 Link to this post

    Hi, I tried to do it, but I'm lost, I don't know how to implements this interface when I'm changing my zooming and scrolling bar, do you please have and example of how to do it?

    How can I loop my series?

    I can do this:
    foreach (DataSeries series in chart_Months.DefaultView.ChartArea.DataSeries)  {
    }

    but I don't know how to get my series. If for example using the scrolling bar I selected a minimum range 2/10 series, is possible to loop just the two selected series by the scrolling bar??

    Thank you.

    Could you please help me on this issue?
    Thank you
  5. Chris Thierry
    Chris Thierry avatar
    138 posts
    Member since:
    Jun 2010

    Posted 13 Jul 2010 Link to this post

    Hi,
    Could you please help me with this?
    Thank you.
  6. Vladimir Milev
    Admin
    Vladimir Milev avatar
    1061 posts

    Posted 14 Jul 2010 Link to this post

    Hello Chris Thierry,

    Just take a look at this example. In it we are subscribing to the PropertyChanged event and are changing the XAxis format strings to match the appropriate zoom range.

    The code in question is:
    RadChart1.DefaultView.ChartArea.ZoomScrollSettingsX.PropertyChanged += ZoomScrollSettingsX_PropertyChanged;
    and
    private void ZoomScrollSettingsX_PropertyChanged(object sender, PropertyChangedEventArgs e)
    {
        double range = (sender as ZoomScrollSettings).Range;
     
        if (range > 0.7d)
        {
            RadChart1.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "yyyy";
            RadChart1.DefaultView.ChartArea.AxisX.StepLabelLevelCount = 1;
        }
        else if (range > 1d / 12d)
        {
            RadChart1.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "MMMM yyyy";
            RadChart1.DefaultView.ChartArea.AxisX.StepLabelLevelCount = 2;
        }
        else if (range > 1d / 12d / 30d)
        {
            RadChart1.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "dd MMM yyyy";
            RadChart1.DefaultView.ChartArea.AxisX.StepLabelLevelCount = 2;
        }
        else
        {
            RadChart1.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "dd-MMM (HH:mm)";
            RadChart1.DefaultView.ChartArea.AxisX.StepLabelLevelCount = 2;
        }
    }


    Hope this helps.

    Sincerely yours,
    Vladimir Milev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Chris Thierry
    Chris Thierry avatar
    138 posts
    Member since:
    Jun 2010

    Posted 19 Jul 2010 Link to this post

    Hi, I'm trying to apply this logic, but I don't know why my method ZoomScrollSettingsX_PropertyChanged is executed more than one time, in my case 3 times, is there any reason?, I'm using the Q2 version of RadControls for Silverlight. I have 3 charts in the same silverlight page, is maybe this the reason?. Just to let you know...I'm just creating my propertychanged event in one of them
    Thank you.
  8. Answer
    Ves
    Admin
    Ves avatar
    2879 posts

    Posted 21 Jul 2010 Link to this post

    Hello Chris,

    PropertyChanged event is fired for every property which is changed for the given object. You can check the value of e.PropertyName and execute your code only for RangeStart and RangeEnd properties.

    Kind regards,
    Ves
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  9. Xie
    Xie avatar
    1 posts
    Member since:
    Mar 2012

    Posted 31 Mar 2012 Link to this post

    I have the same problem, and the selected range is also inaccurate.
  10. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 04 Apr 2012 Link to this post

    Hi Xie,

    I believe Vladimir has described how to achieve the desired result and I have explained why the event would be triggered multiple times. As for the inaccurate selection -- please, feel free to open a support ticket and provide us with all the details about your setup, so that we can review it and get back to you. Thank you.

    Best regards,
    Ves
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top
DevCraft banner