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

margin problems + actual value not equal to value

5 Answers 77 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Tanguy Detroz
Top achievements
Rank 1
Tanguy Detroz asked on 05 Aug 2010, 03:53 PM
Hi,

1) I have been using the chart for a while now and I cannot figure out why I cannot positionnate my zoombar where ever I would like to. Basically, on my chart, I have buttons "day", "week" and "month" that allows me to select the period I want in the chart and navigate by it with "previous" and "next" buttons.

When I setup the zoom value to match one of these period, I cannot set it properly, the actual min and max value is never equal to what I want.

2) In addition to that (and that might be the cause of the first bullet point), my chart has always gap or margin on the left and the right side of the lines (see screenshot).

I need to know what I am doing wrong here as we cannot have these gaps and we must be able to setup the actual min / max via the zoom bar.

Cheers

Chart config:
radChart.DefaultView.ChartArea.AxisY.IsZeroBased = true;
radChart.DefaultView.ChartArea.ZoomScrollSettingsX.ScrollMode = Telerik.Windows.Controls.Charting.ScrollMode.ScrollAndZoom;
radChart.DefaultView.ChartArea.EnableAnimations = false;
radChart.DefaultView.ChartArea.AxisX.AutoRange = true;
radChart.DefaultView.ChartArea.AxisX.IsDateTime = true;
radChart.DefaultView.ChartLegend.Visibility = System.Windows.Visibility.Collapsed;
radChart.DefaultView.ChartArea.ZoomScrollSettingsX.RangeStart = 0;
radChart.DefaultView.ChartArea.ZoomScrollSettingsX.RangeEnd = 1;
radChart.SamplingSettings.SamplingThreshold = 0;

Setting the chart to zoom on one single day :
double OADateFrom = 1 / (radChart.DefaultView.ChartArea.AxisX.MaxValue - radChart.DefaultView.ChartArea.AxisX.MinValue) * (DateTimeFromIWantToDisplay.ToOADate() - radChart.DefaultView.ChartArea.AxisX.MinValue);
  
double OADateTo = 1 / (radChart.DefaultView.ChartArea.AxisX.MaxValue - radChart.DefaultView.ChartArea.AxisX.MinValue) * (DateTimeToIWantToDisplay.ToOADate() - radChart.DefaultView.ChartArea.AxisX.MinValue);
  
radChart.DefaultView.ChartArea.ZoomScrollSettingsX.RangeStart = OADateFrom;
radChart.DefaultView.ChartArea.ZoomScrollSettingsX.RangeEnd = OADateTo;


5 Answers, 1 is accepted

Sort by
0
Tanguy Detroz
Top achievements
Rank 1
answered on 05 Aug 2010, 03:55 PM
I tried, either in auto range true and auto range false ... Same problems, the actual min/max is different from the min/max I define.
0
Tanguy Detroz
Top achievements
Rank 1
answered on 06 Aug 2010, 09:35 AM
After a couple of tests, it seems that, in my example, when I manually set the min value to 40359.916666666664, it automatically round that value to 40359.0 and assign it to the actual min value ... That is the reason for the gap AND the reason why I cannot set the scrollerX where I want because my calculation is then wrong.

Why do you round the actual min/max values ?
0
Bartholomeo Rocca
Top achievements
Rank 1
answered on 06 Aug 2010, 02:17 PM
Hello Tanguy,

I was experiencing something similar, however, Telerik have recently fixed the MinValue rounding issue and everything seems to work OK now. You might want to download the weekly internal build from your Client.Net account to get the fixed version and try it in your project.


Greetings,
Bart.
0
Tanguy Detroz
Top achievements
Rank 1
answered on 13 Aug 2010, 10:59 AM
Dear Telerik Chart Developers,

Regarding my problem above, the good news is that, after installing the Q2, we solved all our chart margin problems, either in autorange = fase or autorange = true ... The chart renders perfectly.

BUT

There is a MAJOR
issue now (I guess it is a bug you haven't seen while release the Q2) that makes the zoom (either by mouse or playing with the zoombar) taking ages to update the chart.

I have made a couple of tests and I found out that with 96 points (meaning almost nothing), the zoom takes 38 seconds to update to chart. Nevertheless, while I am not in SamplingThreshold = 0, the zoom works perfectly almost instantly.

So can you confirm that there is a problem with the zoom while you are in SamplingThreshold = 0 ? I know there is something wrong about your release because just before installing the Q2, the zoom (SamplingThreshold = 0) was working fine even with thousand points.

This is critical for us as we cannot live without a zoom and without showing all points (we don't want sampling).

T.
0
Giuseppe
Telerik team
answered on 18 Aug 2010, 04:04 PM
Hi Tanguy Detroz,

We were unable to reproduce the problematic behavior in our local tests (see the attached sample application).

Could you open a formal support ticket and send us a runnable application that we can investigate locally so we can advise you properly how to proceed.


Sincerely yours,
Freddie
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
Tags
Chart
Asked by
Tanguy Detroz
Top achievements
Rank 1
Answers by
Tanguy Detroz
Top achievements
Rank 1
Bartholomeo Rocca
Top achievements
Rank 1
Giuseppe
Telerik team
Share this question
or