我在剑道图表中相对较新。我有一个图表如下;
@(Html.Kendo().Chart<PlodWareWeb.Models.TotalDrilledBySize>()
.Name("totalDrilledBySizeChart")
.Title("Total Drilled By Size")
.ChartArea(chartArea => chartArea.Background("transparent").Height(350))
.DataSource(dataSource => dataSource.Read(read => read.Action("GetTotalDrilledBySizeChartData", "Home")))
.Legend(legend => legend.Visible(false))
.Series(series =>
{
series.Column(model => model.TotalDrilled, model => model.GroupName);
})
.CategoryAxis(axis => axis.Categories(model => model.HoleSize).Line(line => line.Visible(true)).Labels(labels => labels.Rotation(0)))
.CategoryAxis(axis => axis.Categories(model => model.DisplayName)
.Line(line => line.Visible(false))
.Labels(labels => labels.Rotation(-90).Format("{0}")))
.ValueAxis(axis => axis.Numeric().Labels(labels => labels.Format("{0}")))
.Tooltip(tooltip => tooltip.Visible(true).Format("{0}%").Template("#= series.name #: #= value #")
)
)
如何在模板中将“model.DisplayName”和“model.HoleSize”显示为工具提示?我尝试了以下方法,但它给了我“未定义”。任何人都可以帮忙吗?谢谢你。
.Template("#= model.DisplayName #: #= series.name #: #= value #")
或者
.Template("#= CategoryAxis.model.DisplayName #: #= series.name #: #= value #")