Panning to right does not always work

5 posts, 0 answers
  1. Scott
    Scott avatar
    11 posts
    Member since:
    Oct 2012

    Posted 30 Jul 2013 Link to this post

    I have a RadCartesianChart called chart6Mo.  I set the zoom whenever data is loaded.

    The following code is inside the SizeChanged event for the chart:

    double chartWidth = chart6Mo.PlotAreaClip.Width;
     
    if (chartWidth > 0)
    {
        double fullChartSize = chartWidth * chart6Mo.Zoom.Width;
        chart6Mo.PanOffset = new Point(-(fullChartSize - chartWidth), 1.0); // Pan to right
    }

    This code works most of the time, but sometimes (depending on how many data points there are) it does not pan all the way to the right.  Instead, it pans about 100 pixels short of the rightmost point.  I've tried hard-coding many different zoom values to no avail.  I've also tried setting the pan X value to a very large negative number, but it seems to be ignored when I set it in code, to a number larger than the entire width of the chart.  Can you think of any reason why the above code would not pan all the way to the right?

  2. Scott
    Scott avatar
    11 posts
    Member since:
    Oct 2012

    Posted 31 Jul 2013 Link to this post

    The problem seems to be related to the LastLabelVisibility property of the DateTimeContinuousAxis.  If it is set to "Clip", then panning to the right works in code.  If it is set to "Visible", then it does not always work in code, but always corrects when swiped.  I've spent hours trying to find a solution, but can't.  I don't think that the chart measures its internal panning metrics correctly until after it is actually swiped by the user.  Ideas?

    Thanks,
    Scott
  3. DevCraft banner
  4. Todor
    Admin
    Todor avatar
    778 posts

    Posted 02 Aug 2013 Link to this post

    Hello Scott,

    I couldn't reproduce the behavior that you are describing. You can have a look at the sample that is attached and the screenshot showing how the chart is seemingly panned to its most right position. Let me know if there is anything else that I need to do in order to reproduce your issue.

    Regards,
    Todor
    Telerik
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  5. Scott
    Scott avatar
    11 posts
    Member since:
    Oct 2012

    Posted 02 Aug 2013 Link to this post

    Thank you very much for the sample project.  I've modified your code to reproduce the behavior. Since I can't attach the project to a forum reply, I've opened a ticket with the attached project. 

    Thanks,
    Scott
  6. Todor
    Admin
    Todor avatar
    778 posts

    Posted 05 Aug 2013 Link to this post

    Hello Scott,

    I have responded to the support ticket that you have opened regarding this issue.

    Regards,
    Todor
    Telerik
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Back to Top
DevCraft banner