Profile Picture

Decluttering Surface Labels

Posted By Ioannis Psomadakis 14 Years Ago
Author
Message
Ioannis Psomadakis
Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 1, Visits: 1

Hello,  I need to display the data using the Surface control.  My 3D data is (Numeric, Numeric, Date).  I used the Grid Sub Type.  On the Data settings, the Labels for the Category and Series are set to be strings. So the Chart plots a (Numeric, String, String) surface.

As you can see from the attachment, the Labels are cluttered and one overwrites the other with very small fonts.  Is there way to tell the Chart to display one every say 10 values?  Any recommendation on decluttering and improving the label visibility?

Thanks



Attachments
NevronSample.JPG (190 views, 43.00 KB)
Nevron Support
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: 11 hours ago
Posts: 3,054, Visits: 4,009

Hi Ioannis,

Yes you can modify the number of labels per a group of ticks using custom code (this feature will be exposed in the next edition of the control trough the designer as well):

using System;
using System.Drawing;
using Nevron.GraphicsCore;
using Nevron.Chart;
using Nevron.ReportingServices;

namespace MyNamespace
{
 public class MyClass
 {
  /// <summary>
  /// Main entry point
  /// </summary>
  /// <param name="context"></param>
  public static void RSMain(NRSChartCodeContext context)
  {
   if (context.Document.Charts.Count == 0)
    return;

   NCartesianChart chart = context.Document.Charts[0] as NCartesianChart;
   if (chart == null)
    return;

   NOrdinalScaleConfigurator ordinalScale = chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator as NOrdinalScaleConfigurator;
   if (ordinalScale != null)
   {
    // set number of ticks per label.
    ordinalScale.NumberOfTicksPerLabel = 10;
   }

   ordinalScale = chart.Axis(StandardAxis.Depth).ScaleConfigurator as NOrdinalScaleConfigurator;
   if (ordinalScale != null)
   {
    // set number of ticks per label.
    ordinalScale.NumberOfTicksPerLabel = 10;
   }
  }
 }
}


Alternatively you can use:

ordinalScale.MajorTickMode = MajorTickMode.AutoMaxCount;
ordinalScale.MinTickDistance = new NLength(20);

instead of:

ordinalScale.NumberOfTicksPerLabel = 10;

for the X/Depth axes - in this case the control will place labels spaced between 20 points on the axis.

Let us know if you meet any problems...



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic