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

Legend item visibility

2 Answers 79 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Saran kumar
Top achievements
Rank 1
Saran kumar asked on 24 Sep 2009, 10:26 AM
hi mi having three tables with data sets binding for a three y axis bar chart in radchart. user has the control to select these three databind using check box i.e if the user checks two check boxes out of three one series should be made invisible from other two series. this works fine with the following code. but the issue is if i make series[0] visible false, the legend associated with that is still displaying. i want that also to be suppressed with the above scenario. please help...

Chart display in asp.net with three series

<div style="margin:10px 10px 10px 10px;">

     <telerik:RadChart ID="RadChart1" runat="server" Height="333px" Skin="Hay" UseSession="true"  Legend-Visible="true"

            Width="700px"  AutoLayout="True"

                AutoTextWrap="True" SeriesOrientation="Vertical">

            <Series>

                  <telerik:ChartSeries Name="QUALIFIED_COUNT" Type="Bar"  DataYColumn="QUALIFIED_COUNT" Appearance-BarWidthPercent="30">

                 </telerik:ChartSeries>

                  <telerik:ChartSeries Name="NONQUALIFIED_COUNT" Type="Bar" DataYColumn="NONQUALIFIED_COUNT" Appearance-BarWidthPercent="30" >

                 </telerik:ChartSeries>

                  <telerik:ChartSeries Name="ABANDONED_COUNT" Type="Bar" DataYColumn="ABANDON_COUNT" Appearance-BarWidthPercent="30" >

                 </telerik:ChartSeries>

           </Series>

            <PlotArea>

                <XAxis DataLabelsColumn="creation_month">

                </XAxis>

                <YAxis Appearance-ValueFormat="General"  LabelStep="10"></YAxis>

            </PlotArea>

        </telerik:RadChart>

      </div>  


C# code to make its visibility false:

if (IncludeQualified == "N")  //when the check box is unchecked

                {

                    RadChart1.Series[0].Visible = false; --the bar suppresses  but the legend still there

                    divQualifiedReport.Visible = false;                   

                }

                else

                {

                    gvQualifiedReport.DataSource = dsReport.Tables[1];  --data binding in else

                    gvQualifiedReport.DataBind();

                }

                if (IncludeNonQualified == "N")

this IncludeQualified will set as ā€˜Nā€™ if I uncheck the relevant check box.


thanks

saran


2 Answers, 1 is accepted

Sort by
0
Accepted
Schlurk
Top achievements
Rank 2
answered on 24 Sep 2009, 04:11 PM
Try this:
RadChart1.Series[0].Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.Nothing; 
Worked for my RadChart implementation :)
0
Saran kumar
Top achievements
Rank 1
answered on 25 Sep 2009, 11:41 AM
hi thanks a lot Schlurk, it works fine.... thanks again for your quick reaponce.....
Tags
Chart (Obsolete)
Asked by
Saran kumar
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
Saran kumar
Top achievements
Rank 1
Share this question
or