Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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,512 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

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

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

When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to dynamically set the form action using jQuery.

609 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