or
@model IEnumerable<
SampleProject.GraphValueModel
>
@(Html.Kendo().Chart(Model)
.Name("chart")
.Title(title => title.Position(ChartTitlePosition.Top).Text("Some Customers"))
.DataSource(dataSource => dataSource
.Read(read => read.Action("ChartForAnything", "Home"))
.Group(group => group.Add(model => model.ColumnOrGroupName))
.Sort(sort => sort.Add(model => model.AxisXValue).Ascending())
)
.Series(series => {
series.Column(model => model.IndexValue, model => model.Color)
.Name("close")
.GroupNameTemplate("#= group.value #").Stack(true).Labels(label => { label.Position(ChartBarLabelsPosition.Center).Visible(true).Background("Transparent").Format("p1").Color("#FFFFFF"); });
})
.Legend(legend => legend
.Position(ChartLegendPosition.Top)
)
.ValueAxis(axis => axis.Numeric()
.Labels(labels => labels.Format("p2").Skip(1))
.Axis.Max = 1.0f)
.CategoryAxis(axis => axis
.Categories(model => model.AxisXValue)
.Labels(labels => labels.Format("MMM"))
))
public
class
GraphValueModel
{
public
DateTime AxisXValue {
get
;
set
; }
public
string
SerieName {
get
;
set
; }
public
object
IndexValue {
get
;
set
; }
public
string
Color {
get
;
set
; }
public
string
ColumnOrGroupName {
get
;
set
; }
}
.k-window-titlebar.k-header {<
br
> margin-top:-31px<
br
>}