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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:58:54+00:00 2026-05-16T20:58:54+00:00

HI im trying to create simple pie chart using the MS Chart controls. When

  • 0

HI

im trying to create simple pie chart using the MS Chart controls. When my pie chart gets rendered in the browser i get padding around the pie chart that i cant get rid of. i would like the pie chart to sit up against the edge of the image with no padding or margin. Any ideas on how i can achieve this?

in my code below the padding is highlighted in blue. i.e Chart1.BackColor = System.Drawing.Color.Blue;

 <script type="text/C#" runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            //Set the chart type
            Chart1.Series["Series1"].ChartType = SeriesChartType.Pie;

            //add points
            Chart1.Series["Series1"].Points.AddY(12);
            Chart1.Series["Series1"].Points.AddY(45);
            Chart1.Series["Series1"].Points.AddY(67);

            //set back color of chart object
            Chart1.BackColor = System.Drawing.Color.Blue;

            //set back color of chart area
            Chart1.ChartAreas["ChartArea1"].BackColor = System.Drawing.Color.Green;

        }
    </script>

    <asp:Chart ID="Chart1" runat="server">
        <Series>
            <asp:Series Name="Series1" ChartType="Pie">
            </asp:Series>
        </Series>
        <ChartAreas>
            <asp:ChartArea Name="ChartArea1">
            </asp:ChartArea>
        </ChartAreas>
    </asp:Chart>
  • 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-16T20:58:54+00:00Added an answer on May 16, 2026 at 8:58 pm

    I’m not specifically familiar with the Pie chart, but for a line chart the Position needs to be set within the ChartArea:

    <ChartArea Name="ChartArea1" BackColor="Transparent" BorderWidth="0" >
          <AxisX LineWidth="0" IsMarginVisible="False">
          </AxisX>
          <Position Height="100" Width="100" X="0" Y="0" />
        </ChartArea>
    

    That sets the chart area to start at the top left corner, I believe and take up the entire area of the chart (100% of it). Then you need IsMarginVisible = false to prevent the margin on the left and the right. Hopefully that will work for you.

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

Sidebar

Related Questions

Hi I am trying to create a simple pie chart using the HTML canvas
I am trying to create a simple dialog in MFC using Visual C++. My
I am trying to create a simple page that enters data in to a
I'm trying to create a simple toggling sidebar using jquery, where it expands and
Im using Eclipse 3.4, EclipseMe 1.7.9. Im trying to deploy/create package a simple project
I am trying to create a simple RSS parser using the two frameworks. However
I am trying to create a simple style that highlights the focused UI Element
Im trying to create a simple pan and zoom app using silverlight 4, but
Just trying to create a simple method that counts up 1 on the tally
Trying to create a simple plugin that simply connects to an ftp site, looks

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.