Hi all,
I want to update the labels shown in the category axis in line chart when new data is bound and refresh method is called.
All the values are getting shown in the chart except the labels present in the category axis. FYI the category axis is showing time. So after each minute the category axis should update the time label shown in the chart.
Any help will be very much helpful to me.
Posting my Code for your reference
@(Html.Kendo().Chart(Model)
.Name("RPMchart")
.Legend(legend => legend
.Position(ChartLegendPosition.Bottom)
)
//.DataSource(ds => ds.Read(read => read.Action("MonitoringJson", "Application")))
.Series(series => {
series.Line(model => model.RequestsPerMinute)
.Name("Request Per Minute")
.Labels(labels => labels.Format("{0}").Visible(false));
})
.CategoryAxis(axis => axis
.Categories(model => model.Minute.TimeOfDay)
.Labels(labels => labels.Format("{0}").Rotation(-90))
)
.HtmlAttributes(new { style = "height:400px;width:400px" })
.ValueAxis(axis => axis.Numeric()
.Labels(labels => labels.Format("{0:N0}"))
).Tooltip(tooltip => tooltip
.Visible(true)
.Format("{0:N0}")
)
)
Thanks
Alam
I want to update the labels shown in the category axis in line chart when new data is bound and refresh method is called.
All the values are getting shown in the chart except the labels present in the category axis. FYI the category axis is showing time. So after each minute the category axis should update the time label shown in the chart.
Any help will be very much helpful to me.
Posting my Code for your reference
@(Html.Kendo().Chart(Model)
.Name("RPMchart")
.Legend(legend => legend
.Position(ChartLegendPosition.Bottom)
)
//.DataSource(ds => ds.Read(read => read.Action("MonitoringJson", "Application")))
.Series(series => {
series.Line(model => model.RequestsPerMinute)
.Name("Request Per Minute")
.Labels(labels => labels.Format("{0}").Visible(false));
})
.CategoryAxis(axis => axis
.Categories(model => model.Minute.TimeOfDay)
.Labels(labels => labels.Format("{0}").Rotation(-90))
)
.HtmlAttributes(new { style = "height:400px;width:400px" })
.ValueAxis(axis => axis.Numeric()
.Labels(labels => labels.Format("{0:N0}"))
).Tooltip(tooltip => tooltip
.Visible(true)
.Format("{0:N0}")
)
)
Thanks
Alam