I'm trying to get the baseunitstep to only be used while showing days, and or if the days exceed more then 100 or if you get to many charts to fit, is this possible with the razor extension?
Thanks in advance
1 Answer, 1 is accepted
0
Iliana Dyankova
Telerik team
answered on 07 Feb 2014, 08:50 AM
Hi Mattias,
In order to achieve this I can suggest the following:
In the chart dataBound event check what the categoryAxis.baseUnit is (or any other condition you need);
If it is days set categoryAxis.baseUnitStep through the setOptions() method.
@(Html.Kendo().Chart(Model)
//....
.Events(ev=>ev.DataBound("onDB"))
)
<script>
function onDB(e) {
if (e.sender.options.categoryAxis.baseUnit == "days") {
e.sender.setOptions({
categoryAxis: {
baseUnitStep: 4 // specify the baseUnitStep
}
})
}
}
</script>
Regards,
Iliana Nikolova
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!