Codejock Forums Homepage
Forum Home Forum Home > General > XAML Snippets > Samples and Demo Applications
  New Posts New Posts RSS Feed - COM - VB - XAML Pie Chart Demo
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

COM - VB - XAML Pie Chart Demo

 Post Reply Post Reply
Author
Message
ijwelch View Drop Down
Senior Member
Senior Member


Joined: 20 June 2006
Status: Offline
Points: 262
Post Options Post Options   Thanks (0) Thanks(0)   Quote ijwelch Quote  Post ReplyReply Direct Link To This Post Topic: COM - VB - XAML Pie Chart Demo
    Posted: 22 June 2008 at 2:39am
A basic pie chart in XAML.

Suggestions and comments welcome.

uploads/20080622_023909_Pie_Chart.zip
 
 
Output:
 

ExtremeSuitePro 12.1.1
WinXP SP3
Back to Top
ijwelch View Drop Down
Senior Member
Senior Member


Joined: 20 June 2006
Status: Offline
Points: 262
Post Options Post Options   Thanks (0) Thanks(0)   Quote ijwelch Quote  Post ReplyReply Direct Link To This Post Posted: 22 June 2008 at 2:45am
Oleg,

I was expecting the following markup to work but it just fills the shape with black:

<Canvas>
<Polygon Points='80,80 159,79 158,78 158,76 158,75 158,73 158,72 158,71 158,69 158,68 158,67 157,65 157,64 157,62 156,61 156,60 156,58 155,57 155,56 155,54 154,53 154,52 153,51 153,49 152,48 152,47 151,45 150,44 150,43 149,42 149,40 148,39'>
    <Polygon.Fill>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5, 0">
            <GradientStop Color="#FFFF00" Offset="0"/>
            <GradientStop Color="#00FF00" Offset="1"/>
        </LinearGradientBrush>
    </Polygon.Fill>
</Polygon>
</Canvas>


ExtremeSuitePro 12.1.1
WinXP SP3
Back to Top
Oleg View Drop Down
Admin Group
Admin Group
Avatar

Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 22 June 2008 at 8:00am
Hi,
 
LineGradient now works for Borders/Rectangles only. :-(  
Things will change with GDI+.
 
Thanks for doing this. Its great. Some new Arcs and Curves Tags will be added also. :-)
 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
spain_2008 View Drop Down
Newbie
Newbie
Avatar

Joined: 30 June 2008
Location: Spain
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote spain_2008 Quote  Post ReplyReply Direct Link To This Post Posted: 30 June 2008 at 7:10am
Hola, niños:

Qué, dandele a la teclas. Eso está muy bien.

Os dejo un trocito de codigo que seguro que os pondrá cachondos.

private void CambiaAngleMin(Double p)
        {

            Polygon A = new Polygon();

            int angulo_A, angulo_B;

            if (AngleMax < p)
            {
                angulo_A = (int)p;

                angulo_B = (int)AngleMax;
            }
            else
            {
                angulo_A = (int)AngleMax;

                angulo_B = (int)p;
            }
            A.Points.Add(new Point(55, 55));

          

            while (angulo_A != angulo_B)
            {
                Point Punto = new Point();
                Double Angulo;
                Double x, y;

                // Radianes;
                Angulo = (Math.PI * (angulo_A - 90)) / 180;

                x = Math.Cos(Angulo) * 55;
                y = Math.Sin(Angulo) * 55;

                x = x + 55;
                y = y + 55;

                Punto.X = x;
                Punto.Y = y;
                A.Points.Add(Punto);

                angulo_A--;
            }

           
            A.Points.Add(new Point(55, 55));

            A.Stroke = Brushes.Black;
            A.Fill = Brushes.Red;




            PEDRO.Children.Clear();
            PEDRO.Children.Add(A);

        }

Saludos.-

Hola, chavales!!!
Back to Top
braian87b View Drop Down
Groupie
Groupie
Avatar

Joined: 01 April 2008
Location: Argentina
Status: Offline
Points: 35
Post Options Post Options   Thanks (0) Thanks(0)   Quote braian87b Quote  Post ReplyReply Direct Link To This Post Posted: 02 July 2008 at 11:01am
Originally posted by spain_2008 spain_2008 wrote:

Hola, niños:

Qué, dandele a la teclas. Eso está muy bien.
what?, giving to the keyboard (means writing code), that is very fine

Os dejo un trocito de codigo que seguro que os pondrá cachondos.
here is a piece of code, im sure; you gonna like it
cambia: change
angulo: angle
punto: point
PEDRO: personal name, like 'robert'
private void CambiaAngleMin(Double p)
        {

            Polygon A = new Polygon();

            int angulo_A, angulo_B;

            if (AngleMax < p)
            {
                angulo_A = (int)p;

                angulo_B = (int)AngleMax;
            }
            else
            {
                angulo_A = (int)AngleMax;

                angulo_B = (int)p;
            }
            A.Points.Add(new Point(55, 55));

          

            while (angulo_A != angulo_B)
            {
                Point Punto = new Point();
                Double Angulo;
                Double x, y;

                // Radianes;
                Angulo = (Math.PI * (angulo_A - 90)) / 180;

                x = Math.Cos(Angulo) * 55;
                y = Math.Sin(Angulo) * 55;

                x = x + 55;
                y = y + 55;

                Punto.X = x;
                Punto.Y = y;
                A.Points.Add(Punto);

                angulo_A--;
            }

           
            A.Points.Add(new Point(55, 55));

            A.Stroke = Brushes.Black;
            A.Fill = Brushes.Red;




            PEDRO.Children.Clear();
            PEDRO.Children.Add(A);

        }

Saludos.-
Greetings.-

Back to Top
braian87b View Drop Down
Groupie
Groupie
Avatar

Joined: 01 April 2008
Location: Argentina
Status: Offline
Points: 35
Post Options Post Options   Thanks (0) Thanks(0)   Quote braian87b Quote  Post ReplyReply Direct Link To This Post Posted: 02 July 2008 at 11:03am
and the sing:
Originally posted by spain_2008 spain_2008 wrote:

Hola, niños:
 
Hola, chavales!!! Pues nada vamos a ver si le damos mas vidilla a estos post y dejamos de dejar basura. Consejo: dejad de decir chorradas y pegar codigo que funciones y no tonterias y chorradas. Besos
 
Hello guys!, well, nothing, lets see if we give more live to this post and we leave the crap. Advise: stop saying "chorradas" (stupid thing) and paste code, what functions and no stupids and "chorradas", kisses
 
 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.094 seconds.