This is a migrated thread and some comments may be shown as answers.

Binding produces error: The type of column with name EstKBytesSaved is not numeric

10 Answers 284 Views
Chart (obsolete as of Q1 2013)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
ewart
Top achievements
Rank 1
ewart asked on 29 Jan 2009, 10:01 PM
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.

10 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 02 Feb 2009, 11:57 AM
Hi Ewart,

We tried to reproduce this behavior in a small project, but to no avail. The build configuration did not seem to affect the chart output and it displayed the correct results in both build configurations. Please, find attached this sample project, showing RadChart bound in a similar scenario. I have removed the binaries, so you will need to add  Telerik.WinControls.RadChart.  Give it a try and let us know if you can reproduce the issue with it.

Greetings,
Ves
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Zeya Bakhtyar
Top achievements
Rank 1
answered on 06 Aug 2010, 12:56 AM
I am seeing same error with Chart in the report. Column is double type but error says column is not numeric type.
0
Ves
Telerik team
answered on 10 Aug 2010, 04:05 PM
Hello Zeya Bakhtyar,

I am afraid Ewart did not send us back any additional details, so we are still not aware of the possible reason for this issue. Please, open a formal support ticket and send us a small runnable project, that reproduces the issue, so that we can investigate it. Thank you.

Best regards,
Ves
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Benedict
Top achievements
Rank 1
answered on 12 Sep 2010, 07:09 AM
I am facing the same problem.

  radChartRunningRSSI.Series.Clear();
            radChartRunningRSSI.Series.Add(new ChartSeries("RSSIX", ChartSeriesType.Spline) { DataYColumn = "RssiX", DataXColumn = "Timestamp", YAxisType = ChartYAxisType.Primary });
            radChartRunningRSSI.Series.Add(new ChartSeries("RSSIY", ChartSeriesType.Spline) { DataYColumn = "RssiY", DataXColumn = "Timestamp", YAxisType = ChartYAxisType.Primary });
            radChartRunningRSSI.Series.Add(new ChartSeries("RSSIZ", ChartSeriesType.Spline) { DataYColumn = "RssiZ", DataXColumn = "Timestamp", YAxisType = ChartYAxisType.Primary });
            radChartRunningRSSI.PlotArea.XAxis.DataLabelsColumn = "LabelX";


Later I am databinding

 radChartRunningRSSI.DataSource = t.TagInfos.ToArray();
 radChartRunningRSSI.DataBind();

t.TagInfos is a List of <TagInfo> with Properties RssiX, RssiY etc.

interestingly there is a different error produced, if I do not convert the list to an array.

With the array conversion I get a "The type of column with name  RssiX is not numeric" exception ...


odd thing.

0
Benedict
Top achievements
Rank 1
answered on 12 Sep 2010, 07:16 AM
By the way, did you run your provided source code ? It is simple wrong ....

ser = new ChartSeries("Series3");
ser.DataYColumn = "MyProperty3";
radChart1.Series.Add(ser);


But the third property is called
public int MyPropertyInt { get; set; }

What sort of support quality is it here ?

0
Benedict
Top achievements
Rank 1
answered on 12 Sep 2010, 07:25 AM
If I add the List directly as a DataSource:

I get
   bei Telerik.Charting.Chart.GetException(RenderEngine renderEngine, Exception ex)
   bei Telerik.Charting.Chart.GetImage(Int32 width, Int32 height)
   bei Telerik.Charting.Chart.GetImage()
   bei Telerik.WinControls.UI.RadChart.GetImage()
   bei Telerik.WinControls.UI.RadChart.OnPaint(PaintEventArgs e)
   bei System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
   bei System.Windows.Forms.Control.WmPaint(Message& m)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   bei System.Windows.Forms.ContainerControl.WndProc(Message& m)
   bei System.Windows.Forms.UserControl.WndProc(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
0
Benedict
Top achievements
Rank 1
answered on 12 Sep 2010, 08:58 AM
I invested further time and used your program which loads the datasource within the Form_Load event ...
with this it works with my datastructures too

But if I do the following

  private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
        
            var t = comboBox1.SelectedItem as Tag;
            radChart1.DataSource = t.TagInfos;
            radChart1.DataBind();
        
        }


I am getting the exception ... what is the difference here  ???
The thread context is the same, everything is working in the gui thread.

The only difference is that the  chart is not drawn yet ...
so what is the right way to refresh the chart with bounded data ?
0
Benedict
Top achievements
Rank 1
answered on 12 Sep 2010, 09:09 AM
Ok, I solved it with doing a "dummy" databinding in the Load Event, then subsequent bindings to work.

Very odd behaviour.

0
Sonal Patel
Top achievements
Rank 1
answered on 06 Dec 2010, 06:33 PM
I'm having the same issue.  Can you please post a code sample of how you got this to work.  Thanks.
0
Rishi
Top achievements
Rank 1
answered on 04 Apr 2012, 07:34 PM
I had these kind of problem Just few mints ago, then I see this thread to find out whats happening.

In my scenario. I got an ChartException: The type of column with name CreatedDate is not numeric.    
CreatedTime Format is like  "April2012"

Trouble shooted Steps.
1. For this problem I changed the Createdtime Datatype into varchar from SQL side.
2.From the vb.net side, I found that. I've been binding the for couple of times radchartcontrol in different methods.
   Then I realzed that to clear the chart controle, before binding the data.

Then I used as

radchart.clear()
radchart.datasourece = ds
radchart.databind()

After using it, Am not seeing any issue!
Hope, it will help you out.

Thanks,
Rishi
Tags
Chart (obsolete as of Q1 2013)
Asked by
ewart
Top achievements
Rank 1
Answers by
Ves
Telerik team
Zeya Bakhtyar
Top achievements
Rank 1
Benedict
Top achievements
Rank 1
Sonal Patel
Top achievements
Rank 1
Rishi
Top achievements
Rank 1
Share this question
or