This question is locked. New answers and comments are not allowed.
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:
Setting the chart to zoom on one single day :
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;