Profile Picture

Legend Hyphen

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

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

Regards
Nick

Attachments
legend.png (258 views, 82.00 KB)
Nevron Support
Posted 10 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,087 reputation)Supreme Being (4,087 reputation)Supreme Being (4,087 reputation)Supreme Being (4,087 reputation)Supreme Being (4,087 reputation)Supreme Being (4,087 reputation)Supreme Being (4,087 reputation)Supreme Being (4,087 reputation)Supreme Being (4,087 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 2,959, Visits: 3,345

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
Posted 9 Years Ago
View Quick Profile
Junior Member

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
Last Active: 8 Years Ago
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
Posted 8 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 8 Years Ago
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



Similar Topics


Reading This Topic