Hi Hoken,
The easiest way to workaround such cases is to have a timer that refreshes the chart periodically - that is instead of directly calling refresh you may simply have a flag, which if raised triggers a refresh in response to a timer event - the following code shows how to implement this:
bool refreshChart = false;
private void Form1_Load(object sender, EventArgs e)
{
// setup the chart initially
NChart chart = nChartControl1.Charts[0];
NBarSeries bar = new NBarSeries();
chart.Series.Add(bar);
bar.Values.Add(10);
refreshChart = true;
timer1.Start();
}
private void button1_Click(object sender, EventArgs e)
{
// do some modifiations
Random rand = new Random();
NBarSeries bar = nChartControl1.Charts[0].Series[0] as NBarSeries;
bar.Values.Add(rand.Next(10));
// raise the refresh flag
refreshChart = true;
}
private void timer1_Tick(object sender, EventArgs e)
{
if (refreshChart)
{
refreshChart = false;
nChartControl1.Refresh();
}
}
Hope this helps - let us know if you meet any problems...
Best Regards,
Nevron Support Team