Unequal intervals between axis label values


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

By Elli Kasparidou - 8 Years Ago
Hello everybody!! I am new to nevron and I would like to ask if there is the possibility to calculate and set different intervals for axis label values in heatmap chart, eg instead of a step of 10 in a 300 range, where the intervals would be 0,10,20, etc, to have 0,15,20,50 etc..

Thank you!
By Nevron Support - 8 Years Ago
Hi Elli,

Sure - you need to change the major tick mode of the scale configurator attached to the particular axis. The following code snippet shows how to do that for the primary X/Y axes:

NLinearScaleConfigurator scaleY = new NLinearScaleConfigurator();
scaleY.MajorTickMode = MajorTickMode.CustomStep;
scaleY.CustomStep = 15;
chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = scaleY;

NLinearScaleConfigurator scaleX = new NLinearScaleConfigurator();
scaleX.MajorTickMode = MajorTickMode.CustomStep;
scaleX.CustomStep = 15;
chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = scaleX;

Alternatively you can use custom steps:

NLinearScaleConfigurator scaleY = new NLinearScaleConfigurator();
scaleY.MajorTickMode = MajorTickMode.CustomStep;
scaleY.CustomSteps.Clear();
scaleY.CustomSteps.Add(5);
scaleY.CustomSteps.Add(10);
scaleY.CustomSteps.Add(15);
chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = scaleY;

NLinearScaleConfigurator scaleX = new NLinearScaleConfigurator();
scaleX.MajorTickMode = MajorTickMode.CustomSteps;
scaleX.CustomSteps.Clear();
scaleX.CustomSteps.Add(5);
scaleX.CustomSteps.Add(10);
scaleX.CustomSteps.Add(15);
chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = scaleX;

or you can even custom specify the ticks:

NLinearScaleConfigurator scaleY = new NLinearScaleConfigurator();
scaleY.MajorTickMode = MajorTickMode.CustomTicks;
scaleY.CustomMajorTicks.Clear();
scaleY.CustomMajorTicks.Add(5);
scaleY.CustomMajorTicks.Add(10);
scaleY.CustomMajorTicks.Add(30);
chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = scaleY;

NLinearScaleConfigurator scaleX = new NLinearScaleConfigurator();
scaleX.MajorTickMode = MajorTickMode.CustomTicks;
scaleX.CustomMajorTicks.Clear();
scaleX.CustomMajorTicks.Add(5);
scaleX.CustomMajorTicks.Add(10);
scaleX.CustomMajorTicks.Add(30);
chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = scaleX;


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

By Elli Kasparidou - 8 Years Ago
Hello again and thank you for the immediate response. I managed to solve this issue following the third option.

So in continuation to this implementation, I have another question.

For  my heat map, my dataset has this format ([range1],[range2],z)  for x, y and z Axis
eg. ([0-5],[10-20],5)
      ([5-20],[20-30],10)
      ([20-40],[30-40],33)
      ([40-80],[40-50],22)
Is it possible to give range values to x and y axes as an input instead of distinct values?
By Nevron Support - 8 Years Ago
Hi Elli,
You mean if there is a way to specify a range of x / y values on the heat map to have the same elevation? - if so there is no build in method to do so but it can easily be implemented. Or perhaps you meant something else?