Hide label of lineseries

2 posts, 0 answers
  1. Ramaka
    Ramaka avatar
    1 posts
    Member since:
    Apr 2015

    Posted 01 May 2015 Link to this post

    I have a chart which shows two series, a column series and a line series. The line series should not always be visible. So I created it like this:

     

    <Series>
                 <telerik:ColumnSeries DataFieldY="Emission" Name="Year">
                     <Appearance>
                         <Overlay Gradient="None"></Overlay>
                     </Appearance>
                     <LabelsAppearance DataFormatString="0.00">
                         <TextStyle Color="#62BAE4" FontFamily="Tahoma" FontSize="10px" />
                     </LabelsAppearance>
                     <TooltipsAppearance DataFormatString="0.00" ClientTemplate="#=kendo.format(\'{0:N2}\', dataItem.Emission)# ton co<sub>2</sub>" />
                 </telerik:ColumnSeries>
                 <telerik:LineSeries DataFieldY="AbsoluteGoalEmission" Name="Goal" Visible="false" >
                     <Appearance>
                         <Overlay Gradient="None"></Overlay>
                     </Appearance>
                     <Appearance FillStyle-BackgroundColor="Green" />
                     <LabelsAppearance DataFormatString="0.00" Position="Below" Visible="false"  >
                         <TextStyle Color="Green" FontFamily="Tahoma" FontSize="10px"  />
                     </LabelsAppearance>
                 </telerik:LineSeries>
             </Series>

     

    Note how both the lineseries and the labelsappearance are set to Visible="false"

     

    However...... this doesn't hide the label under the x-axis at all (the line series itself is nicely invisible), all it does is make the label grey as if disabled.

    I need it to do what it implies: completely hide the label.

    What am i missing?

  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1493 posts

    Posted 05 May 2015 Link to this post

    Hello Ramaka,

    I am not able to reproduce the mentioned issue. Setting visible false to the series labels, hides them properly on my side. The chart below renders like this - http://screencast.com/t/oU87G5a1UJi

    ASPX:
    <telerik:RadHtmlChart runat="server" ID="ColumnChart1" Width="600px" Height="400px">
        <PlotArea>
            <Series>
                <telerik:LineSeries Name="Product 1">
                    <LabelsAppearance Visible="false"></LabelsAppearance>
                    <SeriesItems>
                        <telerik:CategorySeriesItem Y="15000" />
                        <telerik:CategorySeriesItem Y="23000" />
                        <telerik:CategorySeriesItem Y="10000" />
                    </SeriesItems>
                </telerik:LineSeries>
            </Series>
            <XAxis>
                <Items>
                    <telerik:AxisItem LabelText="1" />
                    <telerik:AxisItem LabelText="2" />
                    <telerik:AxisItem LabelText="3" />
                </Items>
            </XAxis>
        </PlotArea>
        <ChartTitle Text="Product sales for 2011">
        </ChartTitle>
        <Legend>
            <Appearance Position="Bottom" />
        </Legend>
    </telerik:RadHtmlChart>

    If you want, however, to hide the x-axis labels you should set the visible property in the right place:

    <XAxis>
        <LabelsAppearance Visible="false"></LabelsAppearance>
        <Items>
            <telerik:AxisItem LabelText="1" />
            <telerik:AxisItem LabelText="2" />
            <telerik:AxisItem LabelText="3" />
        </Items>
    </XAxis>


    Regards,
    Danail Vasilev
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top