?
Solved

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

Posted on 2013-06-12
7
Medium Priority
?
1,478 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 1000 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

WordPress Tutorial 3: Plugins, Themes, and Widgets

The three most common changes you will make to your website involve the look (themes), the functionality (plugins), and modular elements (widgets).

In this article we will briefly define each again, and give you directions on how to install them.

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn how to count occurrences of each item in an array.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Suggested Courses

764 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