Please contact support by e-mail and ask to schedule a web meeting - there must be something small we're missing here, but we cannot determine it by exchanging messages in the forum...
Best Regards,Nevron Support Team
Hi Nick,
It's kind of hard to predict the output of the automatic tick calculator because it depends on both the range of the values and the size of the control on the screen. The following code snippet shows how to conditionally modify the step settings:
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]; NBarSeries bar = chart.Series[0] as NBarSeries; if (bar != null) { int maxValueIndex = bar.Values.FindMaxValue(); double maxValue = (double)bar.Values[maxValueIndex]; double minValue = 0; double length = Math.Abs(maxValue - minValue); if (length < 10) { NLinearScaleConfigurator scale = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator; scale.MajorTickMode = MajorTickMode.CustomStep; scale.CustomStep = 1; } } } }}In this code snippet the custom step 1 is enabled when the range of the data is less that 10. We would also recommend to take a look at the chart for .NET API - it is identical with the SSRS API used above and there are 200+ examples showing all aspects of the control features you can touch with source code in SSRS.
Nick,
You can eaither leave the automatic step calculation or provide custom step, based on some custom rule. In the case above since the major tick mode is forced to CustomStep the axis will generate many labels when the range of the data displayed on it is large - for example for a range [0, 100] it will generate 100 ticks. We recommend to stick to the automatic step calculator, but you can also write your own based on the range of the data.
The post is in the Nevron Chart for .NET topic - (this is why we assumed we are talking about .NET integration, not SSRS). The code is the same generally - in SSRS it should look like:
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]; NLinearScaleConfigurator scale = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator; scale.MajorTickMode = MajorTickMode.CustomStep; scale.CustomStep = 1; } }}Please take a look at the code embedding topic shipped with the documentation of the component:
http://helpssrsvision.nevron.com/Chart_Code_Embedding.html
Let us know if you meet any problems...
Hi Michelle,
Currently there is no way to restrict the automatic step calculator to a particular min / max step (though is will be a nice feeature and is easy to implement as well). You can however specify custom step to the scale:
NLinearScaleConfigurator scale = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;scale.MajorTickMode = MajorTickMode.CustomStep;scale.CustomStep = 1;
We're going to implement min max step restriction in the upcoming version.