JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://cdn.kendostatic.com/2012.2.710/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.2.710/styles/kendo.common.min.css">
<link rel="stylesheet" href=""http://cdn.kendostatic.com/2012.2.710/styles/kendo.default.min.css">
<div id='chart'></div>
JavaScript
var dataSource = new kendo.data.DataSource({
data: [{
"ReportDate": "2012-01-02T00:00:00",
"Value": 500.000000},
{
"ReportDate": "2012-06-01T00:00:00",
"Value": 350.000000},
{
"ReportDate": "2012-07-01T00:00:00",
"Value": 100.000000},
{
"ReportDate": "2012-08-16T00:00:00",
"Value": 150.000000},
{
"ReportDate": "2012-08-17T00:00:00",
"Value": 250.000000}]
});
function dataBound(e) {
var chart = $("#chart").data("kendoChart");
if (dataSource.view().length > 4) {
chart.options.categoryAxis.labels.step = 10;
}
else {
chart.options.categoryAxis.labels.step = 1;
}
}
$("#chart").kendoChart({
title: {
text: "Employee Sales"
},
dataSource: dataSource,
series: [{
type: "line",
field: "Value"}],
categoryAxis: {
field: "ReportDate",
type: "Date",
baseUnit: "days"
},
dataBound: dataBound
});