Click here to Skip to main content
15,888,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How can i make a column's visible false with kendo chart?

Here is my code. In this code i have a null category problem which i can't solve so i dont want to show "null category".

How can i make its visible false?

I must male this chart's column[1]'s visible to false.

Here is image of situation.


JavaScript
@(Html.Kendo().Chart(Model)
    .Name("chart")
       
        

       .Legend(legend => legend
            .Visible(true)
            .Position(ChartLegendPosition.Top))
    .Series(series =>
    {
        series
           .Column(model => model.zerotofivevalues , categoryExpression: model => model.zerotofive ).Stack(ChartStackType.Normal)
           .Aggregate(ChartSeriesAggregate.Avg)
              .Labels(labels => labels.Visible(true).Position(ChartBarLabelsPosition.Center));

        series
          .Column(model => model.fivetotenvalue, categoryExpression: model => model.fivetoten).Stack(ChartStackType.Normal)
          .Aggregate(ChartSeriesAggregate.Count)
             .Labels(labels => labels.Visible(true).Position(ChartBarLabelsPosition.Center));

        series
     .Column(model => model.tentofifteenvalue, categoryExpression: model => model.tentofifteen).Stack(ChartStackType.Normal)
     .Aggregate(ChartSeriesAggregate.Count)
        .Labels(labels => labels.Visible(true).Position(ChartBarLabelsPosition.Center));

       


    }) .Theme("metro")
          .Tooltip(tooltip => tooltip
        .Visible(true)
                 .Template("#= series.name #: #= value #"))
            .Events(ev => ev.DataBound("onDB"))

            
                  
            
    )
Posted
Updated 11-Sep-14 2:01am
v2
Comments
ChauhanAjay 11-Sep-14 22:38pm    
Is it possible for you to exclude the null categories from your query?
Fatihx 12-Sep-14 8:20am    
Thanks for replying. It solved like that:

series
.Column(model => model.Value, categoryExpression: model => model.Range)
.Aggregate(ChartSeriesAggregate.Count)
.Labels(labels => labels.Visible(true).Position(ChartBarLabelsPosition.Center));

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900