A Simple Pie Chart Example

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
MMP
Newbie
Newbie
Posts: 11
Joined: Fri Nov 15, 2002 12:00 am
Location: Sweden
Contact:

A Simple Pie Chart Example

Post by MMP » Fri Mar 18, 2005 9:24 am

I'm having real troubles finding chart examples for web charts (ASP.net).

Could you please show me a quick example of how to make a pie chart when I have only two values; 45% and 55%. Preferably in VB.net, but C# is no problem.

I also want those sticky little signs showing "45%" and "55%" respectively.

Thank you,
Mathias

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Mar 18, 2005 10:02 am

Hi Mathias,
I'm having real troubles finding chart examples for web charts (ASP.net).
You should fine live ASP.NET examples included with your TeeChart installation. The examples can be found at the TeeChart program group.
Could you please show me a quick example of how to make a pie chart when I have only two values; 45% and 55%. Preferably in VB.net, but C# is no problem.

I also want those sticky little signs showing "45%" and "55%" respectively.
Yes, you can add a pie series in the WebChart at design-time and then do something like:

Code: Select all

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        With WebChart1.Chart.Series(0)
            .Add(45)
            .Add(55)
            With .Marks
                .Visible = True
                .Style = Steema.TeeChart.Styles.MarksStyles.Percent
            End With
        End With
    End Sub
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

MMP
Newbie
Newbie
Posts: 11
Joined: Fri Nov 15, 2002 12:00 am
Location: Sweden
Contact:

Post by MMP » Fri Mar 18, 2005 10:26 am

narcis wrote:
I'm having real troubles finding chart examples for web charts (ASP.net).
You should fine live ASP.NET examples included with your TeeChart installation. The examples can be found at the TeeChart program group.
Well, I can't find any there. The Feature demo doesn't contain ASP.net examples. If I choose the TeeChart for .Net Examples application and choose the Web tab, I only see this message:
All information about TeeChart Pro at www.teeChart.net

TeeChart for .NET Help only contains the class library.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Mar 18, 2005 11:37 am

Hi Mathias,

Those examples are under the "ASP Server examples" shortcut which points to "C:\Program Files\Steema Software\TeeChart for .NET v1\TeeChartForNET\DemoHome.htm" (default english installation path).
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

MMP
Newbie
Newbie
Posts: 11
Joined: Fri Nov 15, 2002 12:00 am
Location: Sweden
Contact:

Post by MMP » Fri Mar 18, 2005 12:55 pm

But that is only an example with three graphs, and no pie chart. :(

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Mon Mar 21, 2005 7:34 am

Hi Mathias,

Code: Select all

Could you please show me a quick example of how to make a pie chart when I have only two values; 45% and 55%. Preferably in VB.net, but C# is no problem. 
We can modify the example you have already discovered to show the sort of pie series you wish to display.

In the Page_Load event of WebForm1.aspx, please remove all references to ch2 and then add in the following code:

Code: Select all

Steema.TeeChart.Chart ch2=WebChart2.Chart;
if (ch2.Series.Count<2)
{
ch2.Series.Add(new Steema.TeeChart.Styles.Pie());
}
ch2.Header.Font.Color=Color.Yellow;
ch2.Header.Text="Chart 2: Pie demo";
ch2.Legend.Visible=false;
ch2.Series[0].Add(45, "45%");
ch2.Series[0].Add(55, "55%");
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

MMP
Newbie
Newbie
Posts: 11
Joined: Fri Nov 15, 2002 12:00 am
Location: Sweden
Contact:

Post by MMP » Tue Mar 22, 2005 9:14 am

Thank you Chris, but VB is the preferred language. However, I'm having trouble finding simple examples in ASP.net. This time I needed a simple pie chart diagram and when you are new to the TeeChart component, it's hard to find your way to a good result. But the next time, another type is needed and there are few examples.

Mathias
MMP

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Mar 22, 2005 9:39 am

HI Mathias,

You can use one of the site tools available in internat for converting C# code to VB.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply