Context : Ultrachart, style : line chart, winform, databinding
Hi,
I am programming a window containing a Graph (LineChart) that can change depending of the user interaction.
I first code something using the series approach shown below :http://es.infragistics.com/help/topic/EEB8F42A-9BEF-430E-8BAD-B99BB11B26E8
The result was Ok, but I was reinstantiating my ultrachart after each user interaction, that was not nice at all because of the flash due to reinstantiation.
So I plan to use databinding to modify my Series using SeriesCollection.This time it was a big fail with the result (no error is thrown when executing) in the ultrachart I got the message :
Line Chart Error: You must have at least one row and one numeric column
I am doing my databinding this way :
private UltraChart _myUltraChart;
private UltraChartBindingClass _myBindingClass;
//constructor
public ChartBuilder()
{
//some method returning a linechart
_myUltraChart = GetDefaultStyleUltraChart();
_myBindingClass = new UltraChartBindingClass();
//databinding
//with Series : SeriesCollection Series
_myUltraChart.DataSource = _myBindingClass.Series;
_myUltraChart.Data.DataBind();
}
//I got a method that feed my ultrachart :
public void FeedMyUltraChart(IEnumerable myTimeSeries)
foreach (var timeSerie in myTimeSeries)
_myBindingClass.Series.Add(timeSerie);
//I tried here to use _myUltraChart.Data.DataBind(); or _myUltraChart.Series.DataBind(); but nothing worked
//I got a method to clean my series (can't clean anything now, because adding series doesn't work)
public void CleanMySeries()
_myBindingClass.Series.Clear();
What am I doing the wrong way to have my project working?
Regards
Hello pebg,
I made small sample for you with line chart and DataBinding. Could you please take a look at the attached sample and if you have any questions, please feel free to write me.
Hi Georgi,
First thank you for answering so quickly.
I had a look on your sample, but I can't apply such a technique on my project.
I can't load all of my datas on the begining because if I have a lot of curve I can display (about 50 curves, with 1300 points each) and my datas are really heavy to load (they are coming from stored procedure that are not quick to execute).
So, I have to load my datas on demand, that's why I tried to use binding on SeriesCollection to feed my Series on demand.
Do you have a sample matching it?