Kendo UI Sparkline - Datasource/Series/Categories
I have a Kendo UI Sparkline now that I am populating from my model with
the following:
@(Html.Kendo().Sparkline()
.Name("jph-graph")
.Theme("black")
.Type(SparklineType.Column)
.Tooltip(tooltip => tooltip.Format("{0:n2}"))
.Data(Model.jphList.Select(g => g.value).ToList())
)
The Sparkline populates properly with that.
I want to add a category so that I can include that value in my ToolTip.
All I could find were references to using the category, so I started
trying to use .DataSource so I could implement that. Now I can't even get
the Sparkline to populate with the defined Datasource and Series, much
less get the Category working. Here is the code that I have that does NOT
populate the Sparkline.
@(Html.Kendo().Sparkline()
.Name("jph-graph")
.Theme("black")
.Type(SparklineType.Column)
.Tooltip(tooltip => tooltip.Format("{0:n2}"))
.DataSource(ds => Model.jphList.Select(g => new { date =
g.production_date, value = g.value }).ToList())
.Series(series => series.Column("value"))
)
Any help would be appreciated.
No comments:
Post a Comment