Hi. When I bind my chart I get the error Binding produces error: The type of column with name EstKBytesSaved is not numeric
// Display series |
rcChart.DataSource = lstStats; |
rcChart.Series[0].DataYColumn = "EstKBytesSaved"; |
rcChart.Series[1].DataYColumn = "Hits"; |
rcChart.PlotArea.XAxis.DataLabelsColumn = sDataLabelColumn; |
rcChart.DataBind(); |
Where lstStats is a generic <List> of items and both EstKBytesSaved and Hits are declared as
long values. e.g.
|
public long EstKBytesSaved |
{ |
get { return _lEstKBytesSaved ; } |
|
} |
in this scenario, the graph does not produce at all
This error was, and can only be found in production - which makes it really confusing - if I compile the project in RELEASE mode and run the executable, the error appears. If I compile it in DEBUG mode there are no errors and the graph produces just fine! I have a few #if DEBUG statements in the solution, but none of my #DEBUG seem to relate to the charting areas. I wonder what the microsoft compiler is doing here..?
given EstKBytesSaved is declared as a long. I wondered if numeric in this instance meant it had to be a numeric in the database sense, e.g. double in c#. but the
telerik examples use int, so I figured any numeric value would be ok.
if I change my internal values to convert my long to an int, when compiling in RELEASE mode:
public int EstKBytesSaved |
{ |
get { return (int)((long)_lEstBytesSaved / 1024); } |
} |
In this scenario, the graph produces but incorrectly with a message about "no or empty series" (If i loop through and message output the data there are most definetly values.. values which graph correctly in debug mode)
If I change my internal values to convert to a double, when compiling in RELEASE mode, e.g.
public double EstKBytesSaved |
{ |
get { return (double)((long)_lEstBytesSaved / 1024); } |
} |
I get the same "there is no or empty series" error message.
I'm stumped, any ideas where to look next?
Regards
Ewart.