Hi Reimund,
Most likely the item.regptName field does not contain a valid string - I just tested with the following code:
class NItem
{
public NItem(string name, double value)
{
Name = name;
Value = value;
}
public string Name;
public double Value;
}
List<NItem> items = new List<NItem>();
private void Form1_Load(object sender, EventArgs e)
{
NChart chart = nChartControl1.Charts[0];
chart.Series.Add(SeriesType.Bar);
}
private void button1_Click(object sender, EventArgs e)
{
items.Clear();
Random rand = new Random();
items.Clear();
int count = rand.Next(10);
for (int i = 0; i < count; i++)
{
double value = rand.Next(100);
items.Add(new NItem(value.ToString(), value));
}
RefreshChart();
}
private void RefreshChart()
{
NBarSeries series = (NBarSeries)nChartControl1.Charts[0].Series[0];
series.Values.Clear();
NStandardScaleConfigurator scaleConfiguratorX = (NStandardScaleConfigurator)nChartControl1.Charts[0].Axis(StandardAxis.PrimaryX).ScaleConfigurator;
scaleConfiguratorX.MajorTickMode = MajorTickMode.AutoMaxCount;
scaleConfiguratorX.AutoLabels = false;
scaleConfiguratorX.Labels.Clear();
foreach (NItem item in items)
{
scaleConfiguratorX.Labels.Add(item.Name);
series.Values.Add(item.Value);
}
nChartControl1.Refresh();
}
and the control was working properly. Let me know if the problem persists...
Best regards,
Bob