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

Space between Legend Markers

2 Answers 165 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Metallica
Top achievements
Rank 1
Metallica asked on 21 Nov 2016, 05:03 PM

Hi, im trying everything to create some space (or margin) between Legend´s markers, but i can´t do that...

I attach a picture of my problem. I have a green and red legend Markers. They are too close from each other...how can i have some space between them ??

There´s any way to do that? Javascript? jQuery ?

Thanks!

 

 

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 22 Nov 2016, 11:11 AM

Hi,

Here is one way to do this via the underlying Kendo chart widget API (http://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/chart#configuration-legend.labels.margin):

<script>
    function onChartLoad(sender, args) {
        var kChartLegend = sender.get_kendoWidget().options.legend;
        kChartLegend.labels.margin = {};
        kChartLegend.labels.margin.right = 50;
        sender.get_kendoWidget().setOptions({legend: kChartLegend});
    }
</script>
<telerik:RadHtmlChart runat="server" ID="RadHtmlChart1">
    <ClientEvents OnLoad="onChartLoad" />
    <PlotArea>
        <Series>
            <telerik:BarSeries Name="first">
                <SeriesItems>
                    <telerik:CategorySeriesItem Y="1" />
                </SeriesItems>
            </telerik:BarSeries>
            <telerik:BarSeries Name="second">
                <SeriesItems>
                    <telerik:CategorySeriesItem Y="1" />
                </SeriesItems>
            </telerik:BarSeries>
        </Series>
    </PlotArea>
    <Legend>
        <Appearance Position="Bottom">
        </Appearance>
    </Legend>
</telerik:RadHtmlChart>

If you would like to see such properties for the legend items (there are padding and margin properties for the entire legend), I suggest you add that as a feature request to our feedback portal: https://feedback.telerik.com/project/108.

Regards,

Marin Bratanov
Telerik by Progress
Telerik UI for ASP.NET AJAX is ready for Visual Studio 2017 RC! Learn more.
0
Metallica
Top achievements
Rank 1
answered on 22 Nov 2016, 12:45 PM
Thank you Marin! it worked perfectly!
Tags
Chart (HTML5)
Asked by
Metallica
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Metallica
Top achievements
Rank 1
Share this question
or