Applies to: Nevron Chart for Reporting Services (SSRS 2005 and 2008)
How to show every second label on the SSRS chart X axis?
In Nevron Chart for SSRS you can use Custom Code injection to change the X or Y axis labels display sequence.
The following code example will display labels at every fourth tick for the X axis and every second tick for the Y axis:
[C#]
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];
NStandardScaleConfigurator scaleX = chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator as NStandardScaleConfigurator;
scaleX.NumberOfTicksPerLabel = 4;
NStandardScaleConfigurator scaleY = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NStandardScaleConfigurator;
scaleY.NumberOfTicksPerLabel = 2;
}
}
}
Article ID: 182, Created On: 3/8/2011, Modified: 3/9/2011