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 7533485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:44:21+00:00 2026-05-30T05:44:21+00:00

I am working on asp.net web application in which i need to show the

  • 0

I am working on asp.net web application in which i need to show the data in a pie chart. Graph should show both the X Value and Y Value. In below image you can see i am able to display only total on comments in a year but i also want to show the Year next to each color. I tried different thing but so far i have no success.

I am also post code related to Chart

<asp:Chart ID="crtYearWise" runat="server" Height="260px" Width="460px">
    <Titles>
        <asp:Title Name="Title1" Text="Year Wise"
            Alignment="TopCenter" Font="Verdana, 12pt">
        </asp:Title>
    </Titles>
    <Series>
        <asp:Series Name="Series1" CustomProperties="DrawingStyle=Pie,
            PieDrawingStyle=Concave, MaxPixelPointWidth=20" ShadowOffset="1"
            ChartType="Pie" IsValueShownAsLabel="True" >
        </asp:Series>
    </Series>
    <ChartAreas>
        <asp:ChartArea Name="ChartArea1" Area3DStyle-Enable3D="True" AlignmentOrientation="All">
            <Area3DStyle Enable3D="true" />
        </asp:ChartArea>
    </ChartAreas>
</asp:Chart>  

Code Behind

String strSql2 = "SELECT Count(comPostDate) AS 'comTOTAL',  DATEPART(yyyy, comPostDate) AS 'whichYear' ";
strSql2 += " FROM Comments  Group by  DATEPART(yyyy, comPostDate), DATEPART(yyyy, comPostDate) ";
DataSet ds2 = DataProvider.Connect_Select(strSql2);

DataTable dt2 = ds2.Tables[0];
crtYearWise.DataSource = dt2;
crtYearWise.Series["Series1"].XValueMember = "whichYear";
crtYearWise.Series["Series1"].YValueMembers = "comTOTAL";
//crtYearWise.Series["Series1"]["PieLabelStyle"] = "Outside";
crtYearWise.DataBind();

Data and Chart as Image

I would appreciate if some can guide me in this.

Answer: Finally Managed got it with

crtYearWise.Series["Series1"].Label = "Year : #VALX , #VALY";

  • 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-05-30T05:44:24+00:00Added an answer on May 30, 2026 at 5:44 am

    This blog post has some information that will help.

    For example, you can do this by setting:

    <asp:Series Label="#VALX: #VALY" ...
    

    You can also format the X and Y values, e.g.:

    <asp:Series Label="#VALX: #VALY{N0}"
    

    I must say the MSDN documentation on the Chart control is poor; for example the Chart overview doesn’t have any links to “how-to” topics for common tasks like this, and the best source of info seems to be MSDN blog posts.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a ASP.Net web forms application which I inherited from a
Well, simple question. I'm working with VS2008 on an ASP.NET web application which has
I'm working on an ASP .NET 2.0 site which uses a Web Application project
I have created a Web Application in asp.net 2.0. which is working fine on
I am currently working on an ASP.NET 3.5 and C# web application which deals
I am currently working on an ASP.NET 3.5 and C# web application which deals
I'm working on an ASP.NET web application. There's a bill page which has two
I am working on a ASP.NET MVC 2.0 Multi-Presentation web application which would use
I'm working on a web application in ASP.NET MVC which involves a fairly complex
I have an intranet ASP.NET web application in which I need to get the

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.