telerik - Kendo chart setting y axis to integer numeric value -
i using telerik kendo chart , try show integer values y axis. here no problem when values 6 - 8 - 10 example when use code below, values on y axis that:
my y axis chart values(8 , 9)
i get,
7.4 7.6 7.8 8.0 ... ... 9.0
but want set values y axis integer values 6 - 7 - 8 - 9 - 10 etc. how can it? mean how can show integer values on y axis?
here code:
@(html.kendo().chart(model) .name("chart") .title(title => title .text(@viewbag.a) .position(charttitleposition.top)) .legend(legend => legend .visible(true) .position(chartlegendposition.top)) .series(series => { series .column(model => model.a, categoryexpression: model => model.date).name("name") .aggregate(chartseriesaggregate.count) .labels(labels => labels.visible(true).position(chartbarlabelsposition.center)); series .column(model => model.b, categoryexpression: model => model.date).name("name") .aggregate(chartseriesaggregate.count) .labels(labels => labels.visible(true).position(chartbarlabelsposition.center)); }) .events(ev => ev.databound("ondb")) .categoryaxis(axis => axis .date() .baseunit(chartaxisbaseunit.years) .majorgridlines(lines => lines.visible(true)) ) .theme("metro") .tooltip(tooltip => tooltip .visible(true) .template("#= series.name #: #= value #")))
when use code:
.valueaxis(axis => axis.numeric().labels(labels => labels.format("{0:n0}"))),
i y axis values that:
7 8 8 8 8 8 8 9 9 9 9 9 9
you can try adding major unit in value axis of chart. please see below code need append:
.valueaxis(axis => axis.numeric() .labels(labels => labels.format("{0:n0}")) .majorunit(1))
Comments
Post a Comment