Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9124143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:30:26+00:00 2026-06-17T06:30:26+00:00

When I do it without putting chart type is working fine but when I

  • 0

When I do it without putting chart type is working fine but when I set it to pie its not working correct. It put all series name as Point 1 the pie is only 1 blue piece (one circle) and it show only first point (Value).

foreach (var tag in tags)
{
    HtmlNode tagname = tag.SelectSingleNode("a");
    HtmlNode tagcount = tag.SelectSingleNode("span/span");
    chart1.Series.Add(tagname.InnerText);
    chart1.Series[x].Points.AddY(int.Parse(tagcount.InnerText));
    chart1.Series[x].IsValueShownAsLabel = true;
    chart1.Series[x].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie;
    x++;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:30:27+00:00Added an answer on June 17, 2026 at 6:30 am

    You are adding multiple Series, each with one Point. As a result the charting control only displays the first Series.
    I believe what you are wanting to do is adding multiple points to a single Series.

    I’m not sure I understand what you are trying to do with the HtmlNode but the code below demonstrate how to build a simple pie chart from a Dictionary using a tag name as Key and an integer as Value.

            Dictionary<string, int> tags = new Dictionary<string,int>() { 
                { "test", 10 },
                { "my", 3 },
                { "code", 8 }
            };
    
            chart1.Series[0].Points.Clear();
            chart1.Series[0].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie;
            foreach (string tagname in tags.Keys)
            {
                chart1.Series[0].Points.AddXY(tagname, tags[tagname]);
                //chart1.Series[0].IsValueShownAsLabel = true;
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any alternate way to create stored procedure without putting all query in
Is there some way in Python to capture KeyboardInterrupt event without putting all the
is it possible to program a tool that sends music to iPhone/iPod without putting
How can I delete a line without putting it into my default buffer? Example:
Is there any way to access split values without putting them into separate value?
Executing multiple SQL statements without putting them into one transaction is a severe bottleneck
I want to get files from Perforce without putting them into a workspace. E.g.
The following code throw messages without putting them with line break. threads = []
I want to create a file and give it to download without putting itself
in python there is way to declare def 's without putting it in class.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.