This is a migrated thread and some comments may be shown as answers.

.SeriesColors array syntax is wrong using Json data

1 Answer 24 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Cindy
Top achievements
Rank 1
Cindy asked on 05 Nov 2013, 12:25 AM
using syntax to bind to JSON series data, .SeriesColors array syntax error

@(Html.Kendo().Chart(Model)
.Name("chart1")
.Title("IV Capture")
.DataSource(dataSource => dataSource.Read(read => read.Action("FetchChartData", "Home"))
.Group(group => group.Add(model => model.SModality))
.Sort(sort => sort.Add(model => model.Zone).Ascending())
)
.Series(series =>
{
series.Column(model => model.IValue)
.Name("value")
.Stack(true);
})
 
.CategoryAxis(axis =>
axis.Categories(model => model.Zone)
.Labels(labels => labels.ToString())
)
.ValueAxis(axis => axis
.Numeric().Labels(labels => labels.Format("{0}"))
)
  .SeriesColors(["#cd1533", "#d43851", "#dc5c71", "#e47f8f", "#eba1ad","#99d7ef"])
)

above syntax is wrong for .SeriesColors

1 Answer, 1 is accepted

Sort by
0
Iliana Nikolova
Telerik team
answered on 06 Nov 2013, 02:31 PM
Hi Cindy,

The correct syntax for seriesColors is as follows:

//....
.SeriesColors(
   "#cd1533", "#d43851", "#dc5c71", "#e47f8f", "#eba1ad",
   "#009bd7", "#26aadd", "#4db9e3", "#73c8e9", "#99d7ef"
)
For working example take a look at this online demo

Regards,
Iliana Nikolova
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Chart
Asked by
Cindy
Top achievements
Rank 1
Answers by
Iliana Nikolova
Telerik team
Share this question
or