Area Chart Legend with Series


Author
Message
Vahid Mesri
Vahid Mesri
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
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

Replies
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
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
Vahid Mesri
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
Posts: 11, Visits: 67
Thank you very much. This did the trick!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search