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

Hide label of lineseries

1 Answer 363 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Ramaka
Top achievements
Rank 1
Ramaka asked on 01 May 2015, 06:55 AM

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?

1 Answer, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 05 May 2015, 08:41 AM
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.

 
Tags
Chart (HTML5)
Asked by
Ramaka
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Share this question
or