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

Smart Labels not working

3 Answers 109 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chris Thierry
Top achievements
Rank 1
Chris Thierry asked on 12 Jul 2011, 07:50 PM
Hi, I try to use a RadChart with two series definition, one has a BarSeriesDefinition and the other one has a SplineSeriesDefinition, please take a look into the attached image, the last item for my SplineSeriesDefinition is always outside the chart, the real value is 1,982, but the chart shows always 1.98
 
In my code, I changed the SplineSeriesDefinition to a LineSeriesDefinition because I found an example that was using LabelSetting property, the problem is that I didn't find it in my SplineSeriesDefinition:

BarLabelSettings settings = new BarLabelSettings();
settings.Distance = 5;
settings.ShowConnectors = true;
settings.LabelDisplayMode = LabelDisplayMode.MidPoint;
  
this.RadChart.DefaultView.ChartArea.SmartLabelsEnabled = true;
                          
SeriesMapping sm = new SeriesMapping();
//sm.SeriesDefinition = new SplineSeriesDefinition();
sm.SeriesDefinition = new LineSeriesDefinition();
((LineSeriesDefinition)sm.SeriesDefinition).LabelSettings = settings;
sm.SeriesDefinition.ShowItemToolTips = true;
sm.SeriesDefinition.ItemToolTipFormat = "#VAL{c0}";
sm.SeriesDefinition.ItemLabelFormat = sm.SeriesDefinition.ItemToolTipFormat;                        
  
sm.ItemMappings.Add(new ItemMapping("Period", DataPointMember.XCategory));
sm.ItemMappings.Add(new ItemMapping("TotalCostLine", DataPointMember.YValue));
this.RadChart.SeriesMappings.Add(sm);

I tried with different ways but doesn't work. I also used this:

this.RadChartMonthlyCost.DefaultView.ChartArea.LabelFormatBehavior = LabelFormatBehavior.HumanReadable;
this.RadChartMonthlyCost.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Auto;

and I changed LayoutMode without sucess.
Any idea?

Thank you for the support!

3 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 15 Jul 2011, 09:47 AM
Hi Chris Thierry,

Unfortunately this is a specific scenario, in which we are aware an issue exists. Let me clarify about the specifics. When there is a rather flat Line or Spline series, as in your example, with long(ish) labels such a problem with clipping a part of a label may occur when the Width of the chart is not sufficient. Our developers are aware of this issue and will look into resolving it for the future versions of the control.

There are a couple of work-arounds that you may find applicable, though. Firstly, of course, increasing the width of the chart, if possible, so that there is enough space for all labels. Another one would be associating the Line/Spline series with a secondary axis ( which has a different Y axis range than the original Y axis ), so that the series would not be that flat and labels would have sufficient space.

Hope this helps. Please, excuse us for the inconvenience caused.

Kind regards,
Nikolay
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Chris Thierry
Top achievements
Rank 1
answered on 15 Jul 2011, 01:30 PM
OK, I'll try to modify the radchart, when you say "future versions of the control" could be the next one?? Q3?
Thank you.
0
Evgenia
Telerik team
answered on 20 Jul 2011, 08:12 AM
Hello Chris,

We can not give you a definite timeframe for this but I can ensure you that our developers are known of it.
As another workaround for your problem I can suggest that you change the Range of the XAxis by increasing the MaxValue. Make the MaxValue - Oct 10 instead of Sep 10 so that the last SeriesItemLabel has enough space and will be fully readable.

Best wishes,
Evgenia
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
General Discussions
Asked by
Chris Thierry
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Chris Thierry
Top achievements
Rank 1
Evgenia
Telerik team
Share this question
or