This question is locked. New answers and comments are not allowed.
Hi,
I have a chart with a horizontal DateTimeContinuousAxis and a vertical LinearAxis.
If I have the following code, the vertical axis will auto arrange itself.
But if I change to the following
the vertical axis will no longer arrange itself to the minimum of the series, but the minimum will become 0.
All I want is to display a chart from moment A to B, and the points in A and B to be displayed right to the start and right to the end of the chart ( no space before first point - that's why I have set PlotMode on horizontal Axis to "OnTicks") and the linearAxis to auto arrange itself without computing minimum and maximum of it.
I have a chart with a horizontal DateTimeContinuousAxis and a vertical LinearAxis.
<
telerik:RadCartesianChart
Background
=
"red"
x:Name
=
"chart"
MinWidth
=
"400"
MinHeight
=
"300"
>
<
telerik:RadCartesianChart.Behaviors
>
<
telerik:ChartPanAndZoomBehavior
PanMode
=
"Both"
ZoomMode
=
"Both"
/>
</
telerik:RadCartesianChart.Behaviors
>
<
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:DateTimeContinuousAxis
LabelInterval
=
"1"
MajorStepUnit
=
"Minute"
LabelFitMode
=
"None"
PlotMode
=
"OnTicks"
LastLabelVisibility
=
"Hidden"
>
</
telerik:DateTimeContinuousAxis
>
</
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:LinearAxis
/>
</
telerik:RadCartesianChart.VerticalAxis
>
</
telerik:RadCartesianChart
>
If I have the following code, the vertical axis will auto arrange itself.
var items =
new
List<Vm>();
var data =
new
DateTime(2011, 12, 1);
for
(
int
i = 0; i < 12; i++)
{
double
? val = (i % 4) + 10;
if
(val == 10)
val =
null
;
items.Add(
new
Vm { Date = data.AddDays(i), Value = val});
}
var rz = items.Where(ee => ee.Value.HasValue).ToList();
this
.chart.Series[0].ItemsSource = rz;
(chart.HorizontalAxis
as
DateTimeContinuousAxis).Maximum =
new
DateTime(2011, 12, 15);
(chart.HorizontalAxis
as
DateTimeContinuousAxis).Minimum =
new
DateTime(2011, 12, 1).AddDays(1);
public
class
Vm
{
public
DateTime Date {
get
;
set
; }
public
double
? Value {
get
;
set
; }
}
But if I change to the following
var items =
new
List<Vm>();
var data =
new
DateTime(2011, 12, 1);
for
(
int
i = 0; i < 12; i++)
{
double
? val = (i % 4) + 10;
//if (val == 10)
// val = null;
items.Add(
new
Vm { Date = data.AddDays(i), Value = val});
}
var rz = items.Where(ee => ee.Value.HasValue).ToList();
this
.chart.Series[0].ItemsSource = rz;
(chart.HorizontalAxis
as
DateTimeContinuousAxis).Maximum =
new
DateTime(2011, 12, 15);
(chart.HorizontalAxis
as
DateTimeContinuousAxis).Minimum =
new
DateTime(2011, 12, 1).AddDays(1);
the vertical axis will no longer arrange itself to the minimum of the series, but the minimum will become 0.
All I want is to display a chart from moment A to B, and the points in A and B to be displayed right to the start and right to the end of the chart ( no space before first point - that's why I have set PlotMode on horizontal Axis to "OnTicks") and the linearAxis to auto arrange itself without computing minimum and maximum of it.