Legend Hyphen


Author
Message
nick thompson
nick thompson
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
Posts: 6, Visits: 1
Hi there,

How do we remove this hyphen from the legend (see screenshot)?

Regards
Nick
Attachments
legend.png (481 views, 82.00 KB)
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 Nick,

This is caused by an empty values name when you use series grouping. You can wordaround it using some custom code - for example:


using System;
using System.Drawing;
using System.Windows.Forms;
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];
   
   for (int i = 0; i < chart.Series.Count; i++)
   {
    NSeriesBase series = chart.Series[i];
    
    if (series.Name.EndsWith(" - "))
    {
     series.Name = series.Name.Substring(0, series.Name.Length - 3);
    }
   }
  }
 }
}

Next version will have more options for grouped series names. Let us know if you meet any problems...



Best Regards,
Nevron Support Team


Alan Schofield
Alan Schofield
Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)
Group: Forum Members
Posts: 15, Visits: 1

I'm not sure if this is still relevant but I had a similar issue under the following circumstances.

With a stacked column chart:

X = Year
Y = Amount
Data grouped by Category.

Value Grouping:
Label = blank
Value = "=Sum(Fields!Amount.Value)"

Category Grouping:
Label = "=Fields!PeriodDesc.Value"  (this is the readable Year in this case)
Group By= "=Fields!PeriodID.Value" (just the key field for the period)

Series Grouping:
Label = "=Fields!Category.Value"
Group By = "=Fields!Category.Value"

With these setting the legend rendered as "CategoryName -"

However, if I reversed this and set the Series Label to be blank (in the Series Grouping Editor dialog) and set the Label to =Fields!Category.Value (in the Values Grouping Editor) then the legend rendered as expected "CategoryName"

There was no need for any custom code.

Hope this helps somebody....

 

 


Steve Cover
Steve Cover
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)
Group: Forum Members
Posts: 2, Visits: 1
Thanks a lot!

The solution you offered worked perfectly for me.
It was exactly the same issue I was having.

-Sandeep
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