Grid lines intervals for stacked bar chart

2 posts, 0 answers
  1. Patrick
    Patrick avatar
    12 posts
    Member since:
    Sep 2011

    Posted 15 Apr 2015 Link to this post

    We are using Kendo 2014.3.  We have a stacked bar chart which is working fine, with the value axis along the bottom.  We would like to be able to set the grid lines to a different interval, which should be possible now using the Step method.  However, when I try to set Step for any of the value axis elements, it causes that element to disappear.

    Here's a slightly simplified version of the Razor view I'm using:

        @(Html.Kendo().Chart<ProjectChartDataPoint>()
              .Name("ProjectChart")
              .SeriesDefaults(z => z.Bar().Stack(true).Gap(0.5))
              .Series(series =>
              {
                  foreach (var color in Model.Colors)
                  {
                      ProjectChartColor color1 = color;
                      series.Bar(Model.DataPoints.Select(p => p.ColorPoints[color1])).Color(color1.toString());
                  }
              })
              .CategoryAxis(axis => axis.Categories(Model.DataPoints.Select(p => p.Name)))
              .ValueAxis(vaxis =>
                  vaxis
                    .Numeric()
                    .Title("% of budget")
                    //.Labels(labels => labels.Step(20).Visible(true))
                    //.MajorTicks(ticks => ticks.Step(20).Visible(true))
                    //.MajorGridLines(major => major.Step(20).Visible(true))
                    //.MinorTicks(ticks => ticks.Step(10).Visible(true))
                    //.MinorGridLines(minor => minor.Step(10).Visible(true))
               )
              )

    If I uncomment the MajorGridLines line, or any of the others in the value axis, then instead of the interval changing, the grid lines or ticks or whatever disappear entirely.  We have a line chart where this is working fine.

     

  2. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2622 posts

    Posted 17 Apr 2015 Link to this post

    Hi Patrick,

    I tested this scenario and everything is working as expected on my side (screencast capture)? Could you please try a smaller step for the gridlines / ticks and let me know if the issue sill persists? 

    Regards,
    Iliana Nikolova
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top