This is a migrated thread and some comments may be shown as answers.
Grid lines intervals for stacked bar chart
1 Answer 26 Views
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 15 Apr 2015, 10:40 PM

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.

 

1 Answer, 1 is accepted

Sort by
0
Iliana Nikolova
Telerik team
answered on 17 Apr 2015, 10:45 AM
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!
 
Asked by
Patrick
Top achievements
Rank 1
Answers by
Iliana Nikolova
Telerik team
Share this question
or