I have a zoomable chart with a datetime category axis.The ChartAxisBaseUnit is set to Fit.
I can zoom until I reached the milliseconds unit.
Can I limit the Max and Min Base Unit, so I can only zoom between Unit Year and Day?
01.
@(Html.Kendo().Chart(Model.Stats.Items)
02.
.Name(
"temperaturechart"
)
03.
.Title(title => title
04.
.Text(
"Temperature"
)
05.
.Visible(
true
)
06.
.Position(ChartTitlePosition.Top))
07.
.Legend(legend => legend
08.
.Visible(
true
)
09.
.Position(ChartLegendPosition.Bottom)
10.
)
11.
.ChartArea(chart => chart
12.
.Background(
"transparent"
)
13.
)
14.
.Series(series =>
15.
{
16.
series
17.
.Line(model => model.Temperature, categoryExpression: model => model.Date)
18.
.Aggregate(ChartSeriesAggregate.Avg)
19.
.Name(
"Temperature"
);
20.
})
21.
.ValueAxis(axis => axis.Labels(label => label.Format(
"{0:0} °C"
)))
22.
.CategoryAxis(axis => axis
23.
.Date()
24.
.Labels(x => x.Rotation(310))
25.
.BaseUnit(ChartAxisBaseUnit.Fit)
26.
)
27.
.Tooltip(tooltip => tooltip
28.
.Visible(
true
)
29.
.Format(
"{0:0.0} °C"
)
30.
)
31.
.Pannable(pannable => pannable
32.
.Lock(ChartAxisLock.Y)
33.
)
34.
.Zoomable(zoomable => zoomable
35.
.Mousewheel(mousewheel => mousewheel.Lock(ChartAxisLock.Y))
36.
.Selection(selection => selection.Lock(ChartAxisLock.Y))
37.
)
38.
)
Thanks,
Alex