Set initial pan position of a chart?

6 posts, 0 answers
  1. Dominic
    Dominic avatar
    3 posts
    Member since:
    Apr 2013

    Posted 02 Sep 2013 Link to this post

    Hey Telerik Team,

    2 quick questions:

    1. How do I set the starting position of the pan and zoom chart? Eg, I have a series of dates but I want the view to begin at the farthest point on the X axis. Then the user can scroll back in time if they desire. Currently it always begins at the first (left most date).

    2. Is it possible to only show ticks for the date of the data? Eg, 1 June,15 June, 22 July, 24 July, 28 July, 3 Sept. If so, how?

    I'll be using the chart for WP7 and WP8.

    I've tried to find the answer online and the forums without luck.

    Thanks,
    Dominic
  2. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 04 Sep 2013 Link to this post

    Hi Dominic,

    Thanks for writing.

    1. You can use the PanOffset property to do this. Just set it to a Point instance with a very large X value and the chart will pan to its end by clamping the value to the biggest possible according to the provided data.

    2. You can format the labels by providing a corresponding string format. That is done by using the LabelFormat property as described here:

    http://www.telerik.com/help/windows-phone/radchart-axes-datetimeaxes.html

    I hope this helps.

    Regards,
    Deyan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINDOWS PHONE 7.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
  4. Dominic
    Dominic avatar
    3 posts
    Member since:
    Apr 2013

    Posted 04 Sep 2013 Link to this post

    Good to hear from you Deyan,

    1. Thanks, that solved my first question.

    2. The question wasn't related to label formatting - I've got that sorted. I was asking how do I only show dates on the x axis that correspond directly to my data. So if my data is at irregular intervals such as 1 June,15 June, 22 July, 24 July, 28 July, 3 Sept, how do I only have those ticks appear on the chart evenly spaced?

    Thanks,
    Dominic
  5. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 09 Sep 2013 Link to this post

    Hi Dominic,

    Thanks for writing back and for the further details on your questions.

    I think the best option here would be to use a Categorical Axis instead of DateTime one. In this way you will be able to display the exact values and format them accordingly:

    http://www.telerik.com/help/windows-phone/radchart-axes-categoricalaxis.html

    Let me know if you need further assistance with this.

    Regards,
    Deyan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINDOWS PHONE 7.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. Dominic
    Dominic avatar
    3 posts
    Member since:
    Apr 2013

    Posted 11 Sep 2013 Link to this post

    Cheers for the reply Deyan,

    I had a look at the chart you recommended.

    Would you be able to provide a simple example how to create it with a pan ability?

    I tried but couldn't get it working.

    Thanks,
    Dominic

  7. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 16 Sep 2013 Link to this post

    Hi Dominic,

    You do not need to implement anything to enable the Pan and Zoom functionality. You should simply make sure enough data is loaded into the chart so that it exceeds the viewport. Then you simply need to define a Pan and Zoom behavior for it and it will work as expected:

    http://www.telerik.com/help/windows-phone/radchart-features-panzoom.html

    If you still find it difficult to do this, please open a new support ticket and send me your project so that I can setup it for you.

    Regards,
    Deyan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINDOWS PHONE 7.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
DevCraft banner