Hide value from Axis


https://www.nevron.com/Forum/Topic8263.aspx
Print Topic | Close Window

By Malcolm Macleod - 11 Years Ago

Hi All

I am using a radar chart and to make it display better have set the range from -20 to 100.  However, I do not want the value of -20 to apear on my chart and was wondering if anyone knew how to hide a particular value from the axis?

Thanks

By Nevron Support - 11 Years Ago

Hi Malcolm,

You can use custom code to turn off the first label on the radar axes. The following code snippet shows how to do this:

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)
  {
   NRadarChart chart = (NRadarChart)context.Document.Charts[0];
   
   for (int i = 0; i < chart.Axes.Count; i++)
   {
    NRadarAxis axis = (NRadarAxis)chart.Axes[i];
    
    NStandardScaleConfigurator scale = axis.ScaleConfigurator as NStandardScaleConfigurator;
    if (scale != null)
    {
     scale.DisplayFirstLabel = false;
    }
   }
  }
 }
}

Hope this helps - let us know if you meet any problems...

By Malcolm Macleod - 11 Years Ago

Hi

That's brilliant.  Does exactly what I need.

Many Thanks