Profile Picture

Area Chart Legend with Series

Posted By Vahid Mesri 3 Months Ago
Author
Message
Vahid Mesri
Question Posted 3 Months 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: 3 Months Ago
Posts: 7, Visits: 20
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 Team
Posted 3 Months Ago
View Quick Profile
Supreme Being

Supreme Being (3,273 reputation)Supreme Being (3,273 reputation)Supreme Being (3,273 reputation)Supreme Being (3,273 reputation)Supreme Being (3,273 reputation)Supreme Being (3,273 reputation)Supreme Being (3,273 reputation)Supreme Being (3,273 reputation)Supreme Being (3,273 reputation)

Group: Moderators
Last Active: 3 days ago @ 8:33 AM
Posts: 2,593, Visits: 2,279
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 3 Months 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: 3 Months Ago
Posts: 7, Visits: 20
Thank you very much. This did the trick!




Similar Topics


Reading This Topic