Here is the solution given to me by Nevron:
using System;
using System.Drawing;
using System.Windows.Forms;
using Nevron;
using Nevron.GraphicsCore;
using Nevron.Chart;
using Nevron.ReportingServices;
namespace MyNamespace
{
///
/// Sample class
/// public class MyClass
{
///
/// Main entry point
/// ///
public static void RSMain(NRSChartCodeContext context)
{
NChart chart = context.Document.Charts[0];
NAxis axis = chart.Axis(StandardAxis.PrimaryX);
NOrdinalScaleConfigurator ordinalScale = axis.ScaleConfigurator as NOrdinalScaleConfigurator;
if (ordinalScale != null)
{
axis.UpdateScale();
int categoryCount = ordinalScale.Labels.Count;
double[] tickValues = new double[categoryCount];
for (int i = 0; i < categoryCount; i++)
{
tickValues[i] = i + 0.5;
}
NCustomRangeSampler rangeSampler = new NCustomRangeSampler(tickValues);
NScaleTickFactory tickFactory = new NScaleTickFactory(ScaleTickShape.Line,
new NLength(0),
new NSizeL(new NLength(1), new NLength(5, NGraphicsUnit.Point)),
new NConstValueProvider(new NColorFillStyle(Color.Black)),
new NConstValueProvider(new NStrokeStyle(1, Color.Black)),
HorzAlign.Left);
NScaleLevel scaleLevel = new NScaleLevel();
scaleLevel.Decorators.Add(new NSampledScaleDecorator(rangeSampler, tickFactory));
axis.Scale.Levels.Insert(0, scaleLevel);
axis.Scale.OriginLevel = axis.Scale.OriginLevel + 1;
}
}
}
}
This is working great :-)