Green Columns (+) and Red Columns (-) in MVC

2 posts, 0 answers
  1. Ian
    Ian avatar
    73 posts
    Member since:
    Jun 2013

    Posted 19 Jul 2013 Link to this post

    When a value is greater and equal to 0, I need the column to appear Green. Red when it's less than 0.

    In the attached screenshot you'll see that the grid is always the default theme color or orange.

    Html.Kendo().Chart(Model.Results)
        .Name("chartPCT")
        .Title("% Return")
        .Legend(legend => legend.Visible(false))
        .Series(series =>
                series.Column(model => model.Metrics.Return)
                      .Name(Model.ColumnTitle)
                      .Labels(false)
        )
        .ValueAxis(axis => axis.Numeric()
                               .Labels(labels => labels.Format("{0}%")))
        .CategoryAxis(axis => axis
                                  .Categories(model => model.Observation)
                                  .Labels(labels =>
                                      {
                                          labels.Format("MMM");
                                      }))
        .Render();
  2. Ian
    Ian avatar
    73 posts
    Member since:
    Jun 2013

    Posted 19 Jul 2013 Link to this post

    .SeriesDefaults(builder => builder.Column().NegativeColor("#BF2D56").Color("#C0BD7F")) 
Back to Top