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

[Solved] Column Chart - Grouping Previous and Current Store values by Provinces

2 Answers 126 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Jako
Top achievements
Rank 1
Jako asked on 01 Oct 2014, 10:32 AM
Hello

I cannot seem to group my stores together on x-axis who all fall within a province while also having two values per store( current and previous year values).

Help much appreciated.

@(Html.Kendo().Chart(Model.BarChartDataVAL)
                    .Name("VALBarChart")
                    .Theme("Silver")
                   
                    .ChartArea(chartArea => chartArea
                    .Background("#f2f2f2")
                    )
                    .Series(series =>
                    {
                        series.Column(model => model.PreviousValue).Tooltip(tooltip => tooltip
                            .Visible(true)
                            .Template("#=dataItem.Element#: Previous Year R #= kendo.toString(value,'n2') #"));
                        series.Column(model => model.Value).Tooltip(tooltip => tooltip
                            .Visible(true)
                            .Template("#=dataItem.Element#: R #= kendo.toString(value,'n2') #"));
                    })
                    .Legend(legend => legend
                        .Visible(true)
                        .Position(ChartLegendPosition.Top)
                    )
                    .CategoryAxis(axis => axis
                        .Categories(model => model.Province).Labels(labels => labels.Rotation(270))
                        .AxisCrossingValue(0)
                     )
                    .ValueAxis(axis => axis.Numeric()
                    .Labels(labels => labels
                    .Format("R {0:n2}")
                    .Skip(2)
                    .Step(2)
                    )
                ))

2 Answers, 1 is accepted

Sort by
0
Jako
Top achievements
Rank 1
answered on 01 Oct 2014, 10:34 AM
Forgot to attach image to give better idea. I want all the western cape stores together, etc
0
Hristo Germanov
Telerik team
answered on 03 Oct 2014, 07:47 AM
Hi Jako,

Could you try to group by this field like in this example.

If this can't help you you need to modify your data to have the grouped series manually and you need to pass them to the chart.

I hope this help.

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