Nevron Forum

Logarithmic scale problem

https://www.nevron.com/Forum/Topic4147.aspx

By Alex Alex 13 - Wednesday, September 8, 2010

When I use logarithm scale for X axis, pan working incorrect. It squeezes/unsqueezes the view when moving mouse.

Steps to reproduce:
1) create chart with axis X using log scale.
2) generate XValues from 0.000001 to 10 (the wider interval produces the more obvious effect)
3) add zoom and pan tool to the chart
4) zoom an area and try to pan.

Looks like you are using linear panning while you should apply log to the difX when moving mouse, just change it to log(difX)
By Nevron Support - Friday, September 10, 2010

Hi Alexander,

Thank you for pointing our this problem. We just fixed it and it should be working in the next SP of the component, which we'll publish sometime next week.

By Alex Alex 13 - Monday, September 13, 2010

Great! Cant wait for the new version
By Nevron Support - Thursday, September 16, 2010

Hello Alexandr,

You can now download the new service pack which includes the fix (build version: 10.9.5.12).

By Alex Sirotkin - Friday, September 24, 2010

I tried 10.9.5.12 but its looks like bug still exists. Panning with logarithmic scale is working odd(((
By Nevron Support - Friday, September 24, 2010

Hi Alex,

The "weirdness" can be caused by tick rounding, which is enabled by default - the following code pans smoothly in log mode with version 10.9.5.12:

NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];
chart.RangeSelections.Add(new NRangeSelection());

NPointSeries point = new NPointSeries();
point.UseXValues = true;
point.DataLabelStyle.Visible = false;

double value = 1;
for (int i = 0; i < 10; i++)
{
 point.Values.Add(value);
 point.XValues.Add(value);

 value *= 10;
}

chart.Series.Add(point);

NLogarithmicScaleConfigurator scaleX = new NLogarithmicScaleConfigurator();
scaleX.RoundToTickMax = false;
scaleX.RoundToTickMin = false;
chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = scaleX;

NLogarithmicScaleConfigurator scaleY = new NLogarithmicScaleConfigurator();
scaleY.RoundToTickMax = false;
scaleY.RoundToTickMin = false;
chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = scaleY;

nChartControl1.Controller.Tools.Add(new NSelectorTool());
nChartControl1.Controller.Tools.Add(new NDataPanTool());
nChartControl1.Controller.Tools.Add(new NDataZoomTool());

Let us know if the problem persists.

By Alex Sirotkin - Wednesday, September 29, 2010

Yep, it is fixed now, thank you! But I have another problem - our application is using Net. 3.5, is it possible create version for 3.5 net framework, not for 4.0?
By Nevron Support - Wednesday, September 29, 2010

Hi Alex,

If you are working with VS2010 and your application uses .NET 3.5, you will have to install Nevron .NET Vision for VS2008. You may need to add the Chart control to the VS Toolbox manually and you need to update your project references.