Click here to Skip to main content
15,885,366 members
Articles / Desktop Programming / WPF

Simple 3D Pie Chart in WPF

Rate me:
Please Sign up or sign in to vote.
4.19/5 (9 votes)
6 Mar 2009Public Domain3 min read 55.6K   2.1K   22  
A starting point for creating 3D pie charts
<Window x:Class="_3DPie.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="390" Width="450">
    <Grid>
        <DockPanel Width="Auto" VerticalAlignment="Stretch" Height="Auto" HorizontalAlignment="Stretch" Grid.ColumnSpan="1" Grid.Column="0" Grid.Row="0" 
                Margin="0,0,0,0" Grid.RowSpan="1">
            <Viewport3D Name="mainViewport" ClipToBounds="True">
                <Viewport3D.Camera>
                    <OrthographicCamera x:Name="camera" FarPlaneDistance="100" LookDirection="0,10,-10" UpDirection="0,1,0"
                    NearPlaneDistance="-20" Width="100" Position="0,-10,10"/>
                </Viewport3D.Camera>
                <ModelVisual3D>
                    <ModelVisual3D.Content>
                        <DirectionalLight Color="White" Direction="-1,-1,-10"/>
                    </ModelVisual3D.Content>
                </ModelVisual3D>
            </Viewport3D>
        </DockPanel>
    </Grid>
</Window>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under A Public Domain dedication


Written By
Architect ReSound
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions