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

Panning to right does not always work

4 Answers 25 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Scott
Top achievements
Rank 1
Scott asked on 30 Jul 2013, 07:23 PM

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?

4 Answers, 1 is accepted

Sort by
0
Scott
Top achievements
Rank 1
answered on 31 Jul 2013, 02:23 PM
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
0
Todor
Telerik team
answered on 02 Aug 2013, 02:46 PM
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.
0
Scott
Top achievements
Rank 1
answered on 02 Aug 2013, 04:41 PM
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
0
Todor
Telerik team
answered on 05 Aug 2013, 11:36 AM
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.
Tags
Chart
Asked by
Scott
Top achievements
Rank 1
Answers by
Scott
Top achievements
Rank 1
Todor
Telerik team
Share this question
or