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

radHtmlChart Series Labels extend out of Chart Area

3 Answers 275 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Cecilia
Top achievements
Rank 1
Cecilia asked on 06 Aug 2016, 01:31 AM

Hi -

I am looking for a way to fix a radHTMLchart where the series labels extend outside of the chart boundary as shown in the attached picture.

My work around is to set the chart.PlotArea.LabelsAppearance.TextStyle.Margin = "-3" so the series label will appear very close to the end of the bar, but I would like to know if there is a better solution.

Thanks,

Cecilia Daniels

3 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 10 Aug 2016, 07:03 AM
Hi Cecilia,

You can either set different position of the series labels (e.g., inside the series) or set a negative value for the plotarea's margin.

Regards,
Danail Vasilev
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Cecilia
Top achievements
Rank 1
answered on 10 Aug 2016, 01:52 PM

Hi Danail,

Thanks you so much for responding.

Setting the PlotArea's margin would be great, but I could not find that property in the radHTMLChart control. Am I missing something?

For a fix, I wound up changing the PlotArea.YAxis.LabelsApperarance.Step value from 2 (which is the value we use for our charts) back to 1. This forced a label to be created at the end of the Axis, which lengthened it enough for the series label to display.  

Thanks again,

Cecilia Daniels

 

 

0
Accepted
Danail Vasilev
Telerik team
answered on 11 Aug 2016, 05:38 AM
Hi Cecilia,

You can set the margin like that:

<telerik:RadHtmlChart runat="server" ID="PieChart1" Width="400px" Height="400px">
    <PlotArea>
        <Appearance>
            <TextStyle Margin="-30" />
        </Appearance>

A runnable sample is available here as well - http://docs.telerik.com/devtools/aspnet-ajax/controls/htmlchart/troubleshooting/common-issues#there-is-a-redundant-space-between-pie-or-donut-chart-and-its-legend

Regards,
Danail Vasilev
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Chart (HTML5)
Asked by
Cecilia
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Cecilia
Top achievements
Rank 1
Share this question
or