我在KendoStock图表中的工具提示有一个奇怪的问题。根据我显示的天数以及我在导航器中关注的数据总量,我将收到一个日期(类别),该日期(类别)对于显示的系列值不正确。 当我移动导航器时,工具提示中的日期会略有变化。如果我查找它应该显示的数据源中的特定值的日期,它已显示距离正确日期最多10天。有没有办法可以确保工具提示中的日期(类别)始终是与数据源中该特定值相关联的日期?
我尝试在工具提示模板中同时使用“category”和“dataItem.Date”,但两者都给出了相同的结果。
$("#MainLineChart").kendoStockChart({
dataSource: {
transport: {
read: {
url: "/MainApi/Action",
dataType: "json",
type: "POST",
contentType: 'application/json; charset=utf-8'
},
parameterMap: function (data, operation) {
return JSON.stringify({ data: { START: Date.parse($("#Start").val()), END: Date.parse($("#End").val()) } });
}
}
},
dateField: "Date",
valueAxis: { labels: { format: "{0}" } },
series: [
{ name: "Series 1", type: "@chartvalue", field: "SERIES1"},
{ name: "Series 2", type: "@chartvalue", field: "SERIES2"},
{ name: "Series 3", type: "@chartvalue", field: "SERIES3"},
{ name: "Series 4", type: "@chartvalue", field: "SERIES4"}
],
categoryAxis: {
baseUnit: "days",
baseUnitStep: "auto",
maxDateGroups: 30,
labels: { rotation: "auto", dateFormats: { days: "M / d / yyyy" } }
},
navigator: {
series: [{ type: "line", field: "SERIES1"}, { type: "line", field: "SERIES2"}, { type: "line", field: "SERIES3"}, { type: "line", field: "SERIES4"}],
categoryAxis: {
baseUnit: "months",
baseUnitStep: "auto"
}
},
tooltip: {
visible: true,
template: "#= series.name #: #= addCommas(value) # <br/> #= kendo.format(\'{0:D}\', category) #"
},
dragEnd: navigate,
zoomEnd: navigate,
selectEnd: navigate
});