Smart Labels not working

4 posts, 0 answers
  1. Chris Thierry
    Chris Thierry avatar
    138 posts
    Member since:
    Jun 2010

    Posted 12 Jul 2011 Link to this post

    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!

  2. Nikolay
    Admin
    Nikolay avatar
    385 posts

    Posted 15 Jul 2011 Link to this post

    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!

  3. DevCraft banner
  4. Chris Thierry
    Chris Thierry avatar
    138 posts
    Member since:
    Jun 2010

    Posted 15 Jul 2011 Link to this post

    OK, I'll try to modify the radchart, when you say "future versions of the control" could be the next one?? Q3?
    Thank you.
  5. Evgenia
    Admin
    Evgenia avatar
    1406 posts

    Posted 20 Jul 2011 Link to this post

    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!

Back to Top