Hi Bargitta,
The log function is not defined for negative values:
http://en.wikipedia.org/wiki/Log_function
You can workaround this if you rescale the data so that it starts from 0 and use custom value formatting. The following code snippet shows how to display data from 0 to 100 scaled as if it was from -50 to 50:
class CustomValueFormatter : NNumericValueFormatter
{
public CustomValueFormatter(double origin)
{
m_Origin = origin;
}
public override string FormatValue(object value)
{
return base.FormatValue((double)value - m_Origin);
}
public override string FormatValue(double value)
{
return base.FormatValue(value - m_Origin);
}
double m_Origin;
}
private void Form1_Load(object sender, EventArgs e)
{
NChart chart = nChartControl1.Charts[0];
NLineSeries line = new NLineSeries();
line.DataLabelStyle.Visible = false;
line.UseXValues = true;
for (int i = 0; i < 100; i++)
{
line.Values.Add(i);
line.XValues.Add(i);
}
chart.Series.Add(line);
NLogarithmicScaleConfigurator logScale = new NLogarithmicScaleConfigurator();
logScale.LabelValueFormatter = new CustomValueFormatter(50);
chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = logScale;
}
Best Regards,
Nevron Support Team