Profile Picture

Chart freezes on null value

Posted By Geert Koojimans 13 Years Ago
Author
Message
Geert Koojimans
questionmark Posted 13 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 3, Visits: 1
I'm evaluating the Nevron Chart components for winform, and I ran into the following.
I bind a line series to an sqlDataAdapter returning two columns (a datetime column and a 'double' column). Now whenever this 'double' column contains normal values it works like a charm. But when there's a null value somewhere, the chart freezes at startup when onPaint is called and the CPU usage jumps to the ceiling. Debug shows it seems to hang somewhere in the GetNextChunk function.
I have emptydatapoints set to skip. Has anyone experienced something similar before?

constructor:

sqlConnection = new SqlConnection(ConnectString);
sqlSelectCommand =
new SqlCommand(SELECT * FROM tv_TotalMDUCurrent PIVOT( MAX(TotalCurrent) FOR ID IN ([_200],[_4])) AS P ORDER BY tDateTime, sqlConnection);
sqlDataAdapter =
new SqlDataAdapter(sqlSelectCommand);

form OnLoad

foreach (column in table, eg _200 and _4)
{

test = new NLineSeries();
test.DataLabelStyle.Visible =
false;
test.UseXValues =
true;
test.BorderStyle = new NStrokeStyle(Color.OrangeRed);
test.SamplingMode =
SeriesSamplingMode.Enabled;
test.InflateMargins =
true;
test.DataLabelStyle.Visible =
false;
test.MarkerStyle.Visible =
false;
test.SamplingMode =
SeriesSamplingMode.Enabled;
test.Values.EmptyDataPoints.ValueMode = EmptyDataPointsValueMode.Skip;
nChart.Charts[0].Series.Add(test);
nChart.DataBindingManager.AddBinding(0, 0,
"XValues", sqlDataAdapter,XAxisDataColumn);
nChart.DataBindingManager.AddBinding(0, 0,
"Values", sqlDataAdapter, "_200");
nChart.DataBindingManager.AddBinding(0, 0,
"Labels", sqlDataAdapter, "_4");

}

 

Table looks like:

 tDateTime                        _200                              _4
 -----------------------     ------------------------ ------------------------
 2010-12-23 14:57:37.000      0.90000000000000002                     NULL
 2010-12-23 15:02:37.000      0.90000000000000002                     NULL
 2010-12-23 15:07:43.000      0.90000000000000002                     NULL
 2010-12-23 15:12:38.000      0.90000000000000002                     NULL
 2010-12-23 15:17:38.000      0.80000000000000004                     NULL
 2010-12-23 15:25:59.000      0.80000000000000004                     NULL
 2010-12-23 15:30:59.000      0.90000000000000002                     NULL
 2010-12-23 15:35:59.000      0.90000000000000002                     NULL
 2010-12-23 15:40:59.000      0.90000000000000002                     NULL
 2010-12-23 15:46:00.000      0.90000000000000002                     NULL






Similar Topics


Reading This Topic