Solved

Data points insertion error. Only 1 Y values can be set for this data series

Posted on 2013-06-12
7
1,335 Views
Last Modified: 2013-11-11
Hi,

I am creating the spider chart using following data

SourceData:
Subject 	Marks
S1	70
S2	50
S3	66
S4	87
S5	70
S6	87
S7	77

Chart1.DataSource = SourceData;
for (int a = 1; a < SourceData.Columns.Count; a++)
                {
                    String strProdName = SourceData.Columns[a].ColumnName;&#9;
                    Chart1.Series.Add (strProdName);  //Name of the series  
                    Chart1.Series[strProdName].YValueMembers = strProdName;  
                    Chart1.Series[strProdName].XValueMember = SourceData.Columns[0].ColumnName;  
                    Chart1.Series[strProdName].ChartType = SeriesChartType.Radar;

                     
                    Chart1.Series[strProdName].BorderWidth = 3;
                    Chart1.Series[strProdName].Enabled = true;
                    Chart1.Series[strProdName].BorderColor = Color.FromArgb(randonGen.Next(255), randonGen.Next(255), randonGen.Next(255));
                    Chart1.Series[strProdName]["RadarDrawingStyle"] = "Line";
                }

                Chart1.ChartAreas[0].AxisX.MajorGrid.Enabled = false;              
                Chart1.ChartAreas[0].AxisY.LineWidth = 1;

                 //Bind the datasource
                Chart1.DataBind();


While binding the data to chart control I am getting the following error
System.ArgumentOutOfRangeException: Data points insertion error. Only 1 Y values can be set for this data series.
Parameter name: dataSource


Any ideas?
0
Comment
Question by:sam_net
  • 3
  • 2
7 Comments
 

Author Comment

by:sam_net
Comment Utility
Hi,

Any help on this issue?

Thanks.
0
 
LVL 35

Expert Comment

by:Robert Schutt
Comment Utility
Could it be a problem in your SourceData? I tried with this and it works!
DataTable SourceData = new DataTable();
SourceData.Columns.AddRange(new DataColumn[]{new DataColumn("Subject", typeof (string)), new DataColumn("Marks", typeof (int))});
SourceData.Rows.Add(new object[]{"S1",70});
SourceData.Rows.Add(new object[]{"S2",50});
SourceData.Rows.Add(new object[]{"S3",66});
SourceData.Rows.Add(new object[]{"S4",87});
SourceData.Rows.Add(new object[]{"S5",70});
SourceData.Rows.Add(new object[]{"S6",87});
SourceData.Rows.Add(new object[]{"S7",77});

Open in new window

chart
0
 

Author Comment

by:sam_net
Comment Utility
Thanks for reply.

But i need  solution for the above issue(System.ArgumentOutOfRangeException: Data points insertion error. Only 1 Y values can be set for this data series.
Parameter name: dataSource).

 Let me know how to avoid this issue.


Thanks.
0
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 500 total points
Comment Utility
I understand but what I'm trying to say is that your posted code is not the problem per se. How is SourceData actually filled in your code?
0
 

Author Closing Comment

by:sam_net
Comment Utility
Thanks
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now