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

Problem with chart new values: (error StackedLine series must have equal items count)

15 Answers 102 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Arturo
Top achievements
Rank 1
Arturo asked on 23 Aug 2012, 05:33 PM
Hi! yesterday i had an app with many radcharts inside it (around 11) and it worked fine. Today i charged new values into my Db and it crashed showing the next error:

StackedLine series must have equal items count


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: Telerik.Charting.ChartException: StackedLine series must have equal items count

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


How can i solve this? I've already changed it to line and it shows the same error (it's strange because if i have line charts why the error is stackedline? )

15 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 28 Aug 2012, 08:02 AM
Hi Arturo,

This exception is thrown when there are StackedLine series with different number of items, which makes the line behavior undefined at the missing points. It should not be raised with Line series and our local tests do not reproduce the problem. Can you send us a small runnable example, which demonstrates the issue? You can use fake datasource just to show the problem.

Best regards,
Ves
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Arturo
Top achievements
Rank 1
answered on 06 Sep 2012, 06:45 PM
[Thanks, after many ways i've found that the solution it's manage the charts with codebehind.]


Update!!!!

After many data in my SQL, 3 radcharts are not working properly. 2 with the stacked line type, when i use the codebehind show raw data and do not group my data....if I use the chart wizard they show an error and again marks the previous error:

StackedLine series must have equal items count


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: Telerik.Charting.ChartException: StackedLine series must have equal items count 


That's strange because the other 7 charts work fine.


And the other one it's with bar type (vertical), when i group in the chart wizard it puts all the data in the left side of the chart, and this chart it's grouped by date (shows the days but all the bars ignore this)

What can i do to solve this?
0
Arturo
Top achievements
Rank 1
answered on 13 Sep 2012, 04:17 PM
I have more information to attack better the issue.

When I have a chart, if it reach a null value it stops the line and the chart. I'm using telerik controls v 2010.3.1317.40
0
Arturo
Top achievements
Rank 1
answered on 18 Sep 2012, 05:05 PM
As I mentioned I have problems to put null values as zero, this problem it's stopping the chart and I can't see the new values.

I'm using telerik controls v 2010.3.1317.40 

Please help me with this thing
0
Arturo
Top achievements
Rank 1
answered on 27 Sep 2012, 05:21 PM
Any solution to this thing? :(
0
Ves
Telerik team
answered on 02 Oct 2012, 10:55 AM
Hi,

Can you please provide more details about the problem. A small example which reproduces it would be really helpful. Thank you.

Best regards,
Ves
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Arturo
Top achievements
Rank 1
answered on 02 Oct 2012, 03:56 PM
Sure, I'll put the steps that I made to code this.

First of all by a bulk statement and with a CSV file I fill my SQL database everyday.

Then in the .net project I use the radchart control with the chart wizard. The SQL datasource shows the query( select count(*), date from Table where message like '%Success%' ;  )   before a day it's broken ....for example i have a full week , only thursday was a bad day and in the chart the displayed data is MONDAY, TUESDAY, WEDNESDAY  ; after thursday there's no data because thursday had null values  I put a screenshot for support.

Thanks a lot for your help.


0
Ves
Telerik team
answered on 05 Oct 2012, 12:05 PM
Hi Arturo,

Please, find attached an example, showing a databound RadChart null values.

Kind regards,
Ves
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Arturo
Top achievements
Rank 1
answered on 05 Oct 2012, 09:54 PM
Thanks! but i have a question...if i don't know the values (all it's inside the sql datasource select command) how can i set that all the null values will be ZERO ?
0
Ves
Telerik team
answered on 10 Oct 2012, 08:50 AM
Hi Arturo,

You can find the code for this in RadChart1_DataBound event handler, where the following line is executed for every series in the chart:

series.Appearance.EmptyValue.Mode = Telerik.Charting.Styles.EmtyValuesMode.Zero;


Best regards,
Ves
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Arturo
Top achievements
Rank 1
answered on 10 Oct 2012, 04:43 PM
That line shows an error :(      I guess the right way is (on databound of each chart):

int cantseries = RadChart2.Series.Count;
 
for (int i = 0; i < cantseries; i++)
{
 
    RadChart2.Series[i].Appearance.EmptyValue.Mode = Telerik.Charting.Styles.EmtyValuesMode.Zero;
 
    //series1.Appearance.EmptyValue.Mode = Telerik.Charting.Styles.EmtyValuesMode.Zero;
}


Even if that is in my code, it's still doing the same thing (scrolling the series to the left).

I attach 2 images, the first one is the result on the Data base (SQL 2005) and the other one the chart that shows the data.



If you need to view part of the code:

String connectionString = [CnnString] ;
string selectCommand="";
SqlDataAdapter dataAdapter;
DataTable table;
 
 
//Gráfica 2
selectCommand = @"SELECT COMMAND";
 
dataAdapter = new SqlDataAdapter(selectCommand, connectionString);
table = new DataTable();
dataAdapter.Fill(table);
 
RadChart2.DataSource = table;
RadChart2.DataBind();











0
Ves
Telerik team
answered on 15 Oct 2012, 02:50 PM
Hi Arturo,

Please, find attached an updated version of the example. Notice the settings in code-behind:

RadChart1.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.ShortDate;
RadChart1.PlotArea.XAxis.IsZeroBased = false;
RadChart1.DataGroupColumn = "Name";
RadChart1.DataManager.ValuesXColumn = "Date";
RadChart1.DataManager.ValuesYColumns = new string[] { "Value" };

Note also, that RadChart does not support DateTime values in this scenario (when RadChart.DataManager.ValuesXColumnI  is set with the name of the DateTime column. Instead, RadChart supports the OLEAuotmation equivalent, retrieved through the DateTime.ToOADate method.

Best regards,
Ves
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Arturo
Top achievements
Rank 1
answered on 19 Oct 2012, 05:57 AM
thanks but is not working :(  I think I'm not explaining the situation:

By a bulk statement I insert data into a DB, and vía SQL DATA SOURCE I get the radchart.

If i get a null value the chart stops the series. I can't fill it manually because i'm not getting all the data, all it's via  SQL DATA SOURCE.

For example..if a customer gets data from 14/10/2012,15/10/2012,16/10/2012 and 18/10/2012  but it fails on 17/10/2012  it will draw only

14,15 and 16 and no more data, even if it's on the db.   And if a customer started to fill data on 17/10/2012  it doesn't draw anything; thats why i need to draw null data on the radchart.






0
Ves
Telerik team
answered on 23 Oct 2012, 12:04 PM
Hi Arturo,

I am not sure I get the entire situation here. Can you please provide an example with regular asp GridView control, filled with the very same data that you need to populate the chart with. Generally, if data, including lines with null values, gets to the chart, you will get the result as shown in my examples.

Best regards,
Ves
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Arturo
Top achievements
Rank 1
answered on 23 Oct 2012, 04:22 PM
Here we go again.   By a bulk statement i fill my db with the information that I get from CSV files. (See the attached image please to get the real info that i'm using).

Then by a select command i get some info that will be in the radchart. The other image shows the results from ONE select command.

As we can see in the image, the date format is not daily (one worker can get 2 or more values in one day and no values 3 days, etc)  that's why I said that that solution it's not possible for me. I can't set ZERO to null values beacause the info it's in the CSV file
Tags
Chart (Obsolete)
Asked by
Arturo
Top achievements
Rank 1
Answers by
Ves
Telerik team
Arturo
Top achievements
Rank 1
Share this question
or