Profile Picture

Area Chart Legend with Series

Posted By Vahid Mesri 7 Years Ago
Author
Message
Vahid Mesri
Question Posted 7 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 11, Visits: 67
hi,
Hi,

I have got an area chart with a series value which is a field in my dataset.

The legend for the chart is set to show the label of the series plus the label field of the value, seperated by a dash line, in the form of Group1 - Value1.

What I want is to only show the series label in the legend - only show Group1 - but if I leave the label field of the value empty, Nevron component still shows the dash (it shows Group1 - )  Is there a way around the issue?

Many thanks,
Vahid


Nevron Support
Posted 7 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
Hi Vahid,

Currently the only workaround for this issue is to use custom code to remove the trailing dash - you can use the following code:

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)
  {
   NChart chart = context.document.Charts[0];
   
   foreach (NSeriesBase series in chart.Series)
   {
    series.Name = series.Name.Trim();
    if (series.Name.EndsWith("-"))
    {
     series.Name = series.Name.Substring(0, series.Name.Length - 1);
     series.Name = series.Name.Trim();
    }
   }
  }
 }
}
(just copy paste the above code in the code tab of the SSRS designer)

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


Best Regards,
Nevron Support Team



Vahid Mesri
Posted 7 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 11, Visits: 67
Thank you very much. This did the trick!




Similar Topics


Reading This Topic