.SeriesColors array syntax is wrong using Json data

2 posts, 0 answers
  1. Cindy
    Cindy avatar
    10 posts
    Member since:
    Nov 2012

    Posted 04 Nov 2013 Link to this post

    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

  2. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2592 posts

    Posted 06 Nov 2013 Link to this post

    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!
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top