Solved

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

Posted on 2013-06-12
7
1,450 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 

Author Comment

by:sam_net
ID: 39256157
Hi,

Any help on this issue?

Thanks.
0
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 39256184
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
ID: 39260619
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
ID: 39260953
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
ID: 39640721
Thanks
0

Featured Post

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

690 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