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

RadHtmlChart PlotBand Labels

1 Answer 93 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jasdeep
Top achievements
Rank 1
Jasdeep asked on 12 Mar 2015, 03:59 PM
Hi forum,

I want to give numbers as labels to the highlighted PlotBand area. Those labels should be from starting point to the end point and should be on the right yaxis.

Please see the attached file for example. The black lines on the right yaxis should be replaced by the numbers (label). Please provide help ASAP.

Thanks,

Jasdeep 

1 Answer, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 13 Mar 2015, 12:08 PM
Hi Jasdeep,

I have already replied to support ticket opened by you on this regard, so I paste my answer below for the rest of the community.

This is not supported out of the box but you can workaround it as follows:

<script>
    function OnLoad(chart) {
        var kendoWidget = chart.get_kendoWidget();
        kendoWidget.options.valueAxis[1].labels.template = "#if(value === 15000 || value === 20000) {# #=value# #}#";
        kendoWidget.redraw();
    }
</script>
<telerik:RadHtmlChart runat="server" ID="ColumnChart1" Width="600px" Height="400px">
    <ClientEvents OnLoad="OnLoad" />
    <PlotArea>
        <CommonTooltipsAppearance Shared="true"></CommonTooltipsAppearance>
        <Series>
            <telerik:LineSeries Name="Product 1">
                <SeriesItems>
                    <telerik:CategorySeriesItem Y="15000" />
                    <telerik:CategorySeriesItem Y="23000" />
                    <telerik:CategorySeriesItem Y="10000" />
                </SeriesItems>
            </telerik:LineSeries>
        </Series>
        <YAxis>
            <PlotBands>
                <telerik:PlotBand From="15000" To="20000"Color="Green" />
            </PlotBands>
        </YAxis>
        <AdditionalYAxes>
            <telerik:AxisY></telerik:AxisY>
        </AdditionalYAxes>
        <XAxis>
            <AxisCrossingPoints>
                <telerik:AxisCrossingPoint Value="0" />
                <telerik:AxisCrossingPoint Value="1000" />
            </AxisCrossingPoints>
            <Items>
                <telerik:AxisItem LabelText="1" />
                <telerik:AxisItem LabelText="2" />
                <telerik:AxisItem LabelText="3" />
            </Items>
        </XAxis>
    </PlotArea>
</telerik:RadHtmlChart>


Regards,
Danail Vasilev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Jasdeep
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Share this question
or