Profile Picture

How to text align in Pie chart data label

Posted By Amendra Kodituwakku 12 Years Ago
Author
Message
Amendra Kodituwakku
Posted 12 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 0, Visits: 1

Hi,

Can someone tell me how to change a pie chart that has labels outside with arrows (spider mode) with multiline text to be centered aligned and not left or right.

Thanks

AK



Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hi Amendra,

You need to turn off the automatic label alignment for the pie chart series. This currently can be achieved only trough code - you need to copy paste the following code in the Code tab of the designer:

using System;
using System.Drawing;
using Nevron.GraphicsCore;
using Nevron.Chart;
using Nevron.ReportingServices;

namespace MyNamespace
{
 /// <summary>
 /// Sample class
 /// </summary>
 public class MyClass
 {
  /// <summary>
  /// Main entry point
  /// </summary>
  /// <param name="context"></param>
  public static void RSMain(NRSChartCodeContext context)
  {
   if (context.Document.Charts.Count == 0)
    return;
    
   NChart chart = context.Document.Charts[0];
   
   NPieSeries pieSeries = chart.Series[0] as NPieSeries;
   
   if (pieSeries != null)
   {
    pieSeries.AutomaticLabelAlignment = false;
   }
  }
 }
}

Hope this helps - let us know if you meet any problems or have any questions.



Best Regards,
Nevron Support Team



Amendra Kodituwakku
Posted 12 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 0, Visits: 1

That worked thanks.





Similar Topics


Reading This Topic