我正在使用Kendo Bar Chart在ASP.NET MVC中实现图形。但它会根据本地计算机中的时区显示图表值。因此,所有人的图表值都不相同。
我在Kendo中使用以下代码来显示条形图
@(Html.Kendo().Chart(Model)
.Name("chartCampaignPerformance")
.HtmlAttributes(new { @style = "width:100%" })
.Title("")
.Events(ev => ev.DataBound("chartCampPerfColorChange"))
.ChartArea(chartArea => chartArea.Background("Transparent"))
.DataSource(dataSource => dataSource
.Read(read => read.Action("", ""))
.Group(group => group.Add(model => model.GroupValue))
.Sort(sort => sort.Add(model => model.DateValue).Ascending())
)
.Series(series =>
{
series.Column(model => model.ItemCount, categoryExpression: model => model.DateValue, colorExpression: (model => model.ItemColor))
.Aggregate(ChartSeriesAggregate.Sum).Gap(.50).Name("#= group.value #");
})
.CategoryAxis(axis => axis
.Date()
.BaseUnit(ChartAxisBaseUnit.Months)
.MajorGridLines(lines => lines.Visible(true))
)
.Legend(legend => legend
.Visible(true)
.Position(ChartLegendPosition.Bottom)
)
.ValueAxis(axis => axis.Numeric()
.Labels(labels => labels
.Format("{0}")
.Skip(2)
.Step(2)
)
)
.Tooltip(tooltip => tooltip
.Visible(true)
.Template("#= series.name #: #= value #")
)
)
}
IST时区图
CST时区图