Profile Picture

strange behaviour using NLogarithmicScaleConfigurator and CustomMajorTicks

Posted By Matthias Laessig 13 Years Ago

strange behaviour using NLogarithmicScaleConfigurator and...

Author
Message
Matthias Laessig
Posted 13 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 6, Visits: 1
Yes. It's working now. Maybe this should be added to the documentation.

Nevron Support
Posted 13 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hi Matthias,

On a logarithmic scale the custom major ticks actual values are interpretted as Math.Log(logbase, customTick) - just tested with the following code:

   NChart chart = nChartControl1.Charts[0];
   NLogarithmicScaleConfigurator logarithmicScale = new NLogarithmicScaleConfigurator();

   logarithmicScale.CustomMajorTicks.Clear();
   logarithmicScale.MajorTickMode = MajorTickMode.CustomTicks;

   for (double i = 0; i <= max; i++)
   {
    logarithmicScale.CustomMajorTicks.Add(i);
   }

   NLineSeries line = new NLineSeries();

   for (int j = 0; j < 10; j++)
   {
    line.Values.Add(Math.Pow(10, j));
   }

   chart.Series.Add(line);
   chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = logarithmicScale;

and the axis was behaving as expected.

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



Best Regards,
Nevron Support Team



Matthias Laessig
crazy Posted 13 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 6, Visits: 1
I'm using the following code to generate a custom logarithmic scale for my Y axis:

NLogarithmicScaleConfigurator logarithmicScale = new NLogarithmicScaleConfigurator();
logarithmicScale.CustomMajorTicks.Clear();
logarithmicScale.MajorTickMode = MajorTickMode.CustomTicks;
for (double i = min - 5; i <= max + 5; i = i + 5)
logarithmicScale.CustomMajorTicks.Add(i);
logarithmicScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true);
logarithmicScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;
logarithmicScale.MajorGridStyle.LineStyle.Color = Color.Black;
logarithmicScale.MinorGridStyle.SetShowAtWall(ChartWallType.Back, false);
logarithmicScale.UseOrigin = false;
logarithmicScale.ViewRangeInflateMode = ScaleViewRangeInflateMode.MajorTickExtend;
logarithmicScale.InflateViewRangeBegin = true;
logarithmicScale.InflateViewRangeEnd = true;
logarithmicScale.RulerStyle.BorderStyle.Color = Color.Black;
logarithmicScale.OuterMajorTickStyle.LineStyle.Color = Color.Black;
logarithmicScale.InnerMajorTickStyle.Length = new NLength(0);
logarithmicScale.OuterMajorTickStyle.Length = new NLength(2);
logarithmicScale.LabelStyle.TextStyle.FillStyle = new NColorFillStyle(Color.Black);

Using this code the axis just shows no labels or gridlines (so I can not say if it is scaled logarithmically or not).

Just changing the first line to:

NLinearScaleConfigurator logarithmicScale = new NLinearScaleConfigurator();

and my code works as expected. Did I find a bug or am I missing something here?

Regards,
Matthias.



Similar Topics


Reading This Topic