Ask a questionAsk a question
 

AnswerMulti level pie chart?

Answers

  • Thursday, November 05, 2009 6:13 PMCole Brand Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     AnswerHas Code
    That's a manual op if I'm not mistaken. But look at Stacked Pie Charts (2 screenshots in the gallery)

    I host my websamples on my local IIS for faster lookups (from the root of the website), but here's my path where you should start http://servername/websamples/content.aspx?Sample=Sample44&SampleSequenceID=166

    I see this code:

    /// <summary>
    
    /// This method will create a ChartArea with a given name at a certain level
    /// </summary>
    private void CreateChartArea(int level, string AreaName, bool ShowBorder)
    {
    Chart1.ChartAreas.Add(AreaName);
    Chart1.ChartAreas[AreaName].BackColor = Color.Transparent;

    if (ShowBorder)
    Chart1.ChartAreas[AreaName].BorderWidth = 1;
    else
    Chart1.ChartAreas[AreaName].BorderWidth = 0;

    Chart1.ChartAreas[AreaName].InnerPlotPosition.Auto = false ;
    Chart1.ChartAreas[AreaName].InnerPlotPosition.Height = 100;
    Chart1.ChartAreas[AreaName].InnerPlotPosition.Width = 100;
    Chart1.ChartAreas[AreaName].InnerPlotPosition.X = 0;
    Chart1.ChartAreas[AreaName].InnerPlotPosition.Y = 0;

    Chart1.ChartAreas[AreaName].Position.X = 2 + level * 15;
    Chart1.ChartAreas[AreaName].Position.Y = 2 + level * 15;
    Chart1.ChartAreas[AreaName].Position.Height = 96 - level * 30;
    Chart1.ChartAreas[AreaName].Position.Width = 96 - level * 30;

    }
    Does this help?
    Please don't forget (and feel free to remind me) to post if you got the answer you wanted, and select who really answered your post when you do so future visitors will know too! Remember, this is .NET 4.0 in a .NET 3.5 world, you're a pioneer right now.

All Replies

  • Thursday, November 05, 2009 6:13 PMCole Brand Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     AnswerHas Code
    That's a manual op if I'm not mistaken. But look at Stacked Pie Charts (2 screenshots in the gallery)

    I host my websamples on my local IIS for faster lookups (from the root of the website), but here's my path where you should start http://servername/websamples/content.aspx?Sample=Sample44&SampleSequenceID=166

    I see this code:

    /// <summary>
    
    /// This method will create a ChartArea with a given name at a certain level
    /// </summary>
    private void CreateChartArea(int level, string AreaName, bool ShowBorder)
    {
    Chart1.ChartAreas.Add(AreaName);
    Chart1.ChartAreas[AreaName].BackColor = Color.Transparent;

    if (ShowBorder)
    Chart1.ChartAreas[AreaName].BorderWidth = 1;
    else
    Chart1.ChartAreas[AreaName].BorderWidth = 0;

    Chart1.ChartAreas[AreaName].InnerPlotPosition.Auto = false ;
    Chart1.ChartAreas[AreaName].InnerPlotPosition.Height = 100;
    Chart1.ChartAreas[AreaName].InnerPlotPosition.Width = 100;
    Chart1.ChartAreas[AreaName].InnerPlotPosition.X = 0;
    Chart1.ChartAreas[AreaName].InnerPlotPosition.Y = 0;

    Chart1.ChartAreas[AreaName].Position.X = 2 + level * 15;
    Chart1.ChartAreas[AreaName].Position.Y = 2 + level * 15;
    Chart1.ChartAreas[AreaName].Position.Height = 96 - level * 30;
    Chart1.ChartAreas[AreaName].Position.Width = 96 - level * 30;

    }
    Does this help?
    Please don't forget (and feel free to remind me) to post if you got the answer you wanted, and select who really answered your post when you do so future visitors will know too! Remember, this is .NET 4.0 in a .NET 3.5 world, you're a pioneer right now.