Practical WPF Charts and Graphics

Book description

Creating 2D and 3D charts is one of the most common uses of computer graphics. Such charts can have wide applications in representing mathematical, physical, and economic functions in your daily life. Whether you are an engineer, a quantitative analyst, a teacher, or a student, you will end up dealing with charting applications to some degree.

Windows Presentation Foundation (WPF) is a next-generation graphics platform that enables you to build advanced user interfaces incorporating documents, media, 2D and 3D graphics, and animations. It is an ideal development tool that allows you to not only generate data, but also easily represent data graphically.

Practical WPF Charts and Graphics provides all the tools you will need to develop professional chart and graphics applications in WPF and C#. This book will be useful for WPF and C# programmers of all skill levels, providing a complete and comprehensive explanation of WPF's graphics capability and the creation of various charts, and paying special attention to the details of code implementation.

Table of contents

  1. Cover
  2. Title
  3. Copyright
  4. Dedication
  5. Contents at a Glance
  6. Contents
  7. About the Author
  8. Technical Reviewer
  9. Acknowledgments
  10. Introduction
  11. Chapter 1: Overview of WPF Programming
    1. New features in WPF
    2. XAML Basics
      1. Why Is XAML Needed?
      2. Creating XAML Files
      3. Code-Behind Files
    3. Your First WPF Program
      1. Properties in XAML
      2. Event Handlers in Code-Behind Files
    4. Code-Only Example
    5. XAML-Only Example
  12. Chapter 2: 2D Transformations
    1. Basics of Matrices and Transformations
      1. Vectors and Points
      2. Scaling
      3. Reflection
      4. Rotation
      5. Translation
    2. Homogeneous Coordinates
      1. Translation in Homogeneous Coordinates
      2. Scaling in Homogeneous Coordinates
      3. Rotation in Homogeneous Coordinates
      4. Combining Transforms
    3. Vectors and Matrices in WPF
      1. Vector Structure
      2. Matrix Structure
      3. Matrix Operations
      4. Matrix Transforms
      5. Creating Perpendicular Lines
    4. Object Transformations in WPF
      1. MatrixTransform Class
      2. ScaleTransform Class
      3. TranslateTransform Class
      4. RotateTransform Class
      5. SkewTransform Class
      6. Composite Transforms
  13. Chapter 3: WPF Graphics Basics in 2D
    1. 2D Coordinate Systems in WPF
      1. Default Coordinates
      2. Custom Coordinates
      3. Custom Coordinates for 2D Charts
    2. Basic 2D Graphics Shapes in WPF
      1. Lines
      2. Rectangles and Ellipses
      3. Polylines
      4. Polygons
    3. Paths and Geometries
      1. Line, Rectangle, and Ellipse Geometries
      2. GeometryGroup Class
      3. CombinedGeometry Class
      4. PathGeometry Class
      5. Geometry and Mini-Language
      6. Hit Testing
    4. Custom Shapes
      1. Star Class
      2. ArrowLine Class
      3. Testing Custom Shapes
  14. Chapter 4: Colors and Brushes
    1. Colors
      1. System Colors
      2. Color Picker
    2. Brushes
      1. SolidColorBrush
      2. LinearGradientBrush
      3. RadialGradientBrush
      4. DrawingBrush
    3. Custom Colormap and Shading
      1. Custom Colormap Brushes
      2. Testing Colormap Brushes
      3. Color Shading
      4. Testing Color Shading
  15. Chapter 5: 2D Line charts
    1. Simple Line Charts
      1. Creating Simple Line Charts
      2. How It Works
    2. Line Charts with Data Collection
      1. Chart Style
      2. Data Series
      3. Data Collection
      4. Creating Line Charts
    3. Gridlines and Labels
      1. Chart Style with Gridlines
      2. Creating a Chart with Gridlines
    4. Legends
      1. Legend Class
      2. Creating a Chart with a Legend
    5. Symbols
      1. Defining Symbols
      2. Symbols Class
      3. Creating a Chart with Symbols
    6. Line Charts with Two Y Axes
      1. Why We Need Two Y Axes
      2. Chart Style with Two Y Axes
      3. DataSeries and DataCollection with Two Y Axes
      4. Creating a Chart with Two Y Axes
  16. Chapter 6: Specialized 2D Charts
    1. Bar Charts
      1. DataSeries for Bar Charts
      2. DataCollection for Bar Charts
      3. Creating Simple Bar Charts
      4. Creating Group Bar Charts
      5. Creating Overlay Bar Charts
      6. Creating Stacked Bar Charts
    2. Stair-Step Charts
      1. DataSeries for Stair-Step Charts
      2. DataCollection for Stair-Step Charts
      3. Creating Stair-Step Charts
    3. Stem Charts
      1. DataCollection for Stem Charts
      2. Creating Stem Charts
    4. Error Bar Charts
      1. DataSeries for Error Bars
      2. DataCollection for Error Bars
      3. Creating Error Bar Charts
    5. Area Charts
      1. DataSeries for Area Charts
      2. DataCollection for Area Charts
      3. Creating Area Charts
    6. Polar Charts
      1. Chart Style for Polar Charts
      2. DataCollection for Polar Charts
      3. Creating Polar Charts
    7. Pie Charts
      1. Pie Chart Style
      2. Legend for Pie Charts
      3. Creating Pie Charts
  17. Chapter 7: Stock Charts
    1. Static Stock Charts
      1. Text File Reader
      2. DataSeries and DataCollection for Stock Charts
      3. Hi-Lo Stock Charts
      4. Hi-Lo Open-Close Stock Charts
      5. Candlestick Stock Charts
    2. Moving Averages
      1. Simple Moving Averages
      2. Weighted Moving Averages
      3. Exponential Moving Averages
    3. Using Yahoo Stock Charts in WPF
      1. Connecting to Yahoo Stock Charts
      2. Creating Yahoo Stock Charts in WPF
  18. Chapter 8: Interactive 2D Charts
    1. Automatic Tick Placement
      1. Optimal Tick Spacing
      2. Creating Charts with Automatic Ticks
    2. Chart Panning with a Mouse
    3. Chart Zooming with a Mouse
    4. Chart Zooming with a Mouse Wheel
    5. Retrieving Chart Data
  19. Chapter 9: 2D Chart Controls
    1. Line Chart Control
      1. Defining Dependency Properties
      2. Using the Line Chart Control
    2. Specialized 2D Chart Control
      1. Bar Chart Control
      2. Stair-Step Chart Control
      3. Stem Chart Control
      4. Error Bar Control
      5. Area Chart Control
      6. Polar Chart Control
      7. Pie Chart Control
      8. Creating Multiple Charts
  20. Chapter 10: Data Interpolations
    1. Linear Interpolation
      1. Algorithm
      2. Implementation
      3. Testing Linear Interpolation
    2. Lagrange Interpolation
      1. Algorithm
      2. Implementation
      3. Testing Lagrange Interpolation
    3. Barycentric Interpolation
      1. Algorithm
      2. Implementation
      3. Testing Barycentric interpolation
    4. Newton Divided-Difference Interpolation
      1. Algorithm
      2. Implementation
      3. Testing Newton Divided-Difference Interpolation
    5. Cubic Spline Interpolation
      1. Algorithm
      2. Implementation
      3. Testing Cubic Spline Interpolation
  21. Chapter 11: Curve Fitting
    1. Linear Algebraic Equations
      1. Gauss-Jordan Algorithm
      2. Implementation
    2. Least-Squares Fit
    3. Straight-Line Fit
      1. Implementation
      2. Testing Straight-Line Fit
    4. Linear Regression
      1. Implementation
      2. Testing Linear Regression
    5. Polynomial Fit
      1. Implementation
      2. Testing Polynomial Fit
    6. Weighted Linear Regression
      1. Implementation
      2. Exponential-Function Fit
  22. Chapter 12: 3D Transformations
    1. 3D Matrices in WPF
      1. 3D Points and Vectors
      2. Matrix3D Structure
      3. Matrix3D Operations
      4. Matrix3D Transforms
      5. Rotation and Quaternion
    2. Projections
      1. Orthographic Projections
      2. Perspective Projections
    3. Views and Projections in WPF
      1. View Transform
      2. Perspective Projection
      3. Orthographic Projection
    4. Object Transforms in WPF
      1. ScaleTransform3D Class
      2. TranslateTransform3D class
      3. RotateTransform3D Class
      4. MatrixTransform3D Class
      5. Combining Transforms
  23. Chapter 13: WPF Graphics Basics in 3D
    1. 3D Graphics Basics
      1. Viewport3D
      2. 3D Objects in WPF
      3. Geometry and Mesh
      4. GeometryModel3D and Surfaces
      5. Illuminating the Scene
      6. Camera Position
      7. Simple Triangle in 3D
    2. Basic 3D Shapes
      1. Coordinate Axes and Wireframe
      2. Creating a Cube
      3. Creating a Sphere
      4. Creating a Cylinder
      5. Creating a Cone
      6. Creating a Torus
  24. Chapter 14: 3D Charts with the WPF 3D Engine
    1. Simple Surfaces
      1. Rectangular Meshes
      2. SimpleSurface Class
      3. Creating Simple Surfaces
    2. Parametric Surfaces
      1. ParametricSurface Class
      2. Creating Parametric Surfaces
    3. Extruded Surfaces
      1. ExtrudeSurface Class
      2. Creating Extruded Surfaces
    4. Surfaces of Revolution
      1. RotateSurface Class
      2. Creating Surfaces of Revolution
    5. Surface Shading
      1. SurfaceShading Class
      2. Creating Shaded Surfaces
  25. Chapter 15: 3D Charts Without the WPF 3D Engine
    1. 3D Coordinate System
      1. Azimuth and Elevation View
      2. Creating a Cube
    2. Chart Style in 3D
      1. 3D Coordinate Axes
      2. Gridlines
      3. Labels
      4. Testing the Project
    3. 3D Line Charts
      1. Implementation
      2. Testing the Project
    4. 3D Surface Charts
      1. Implementation
      2. Mesh Charts
      3. Curtain Charts
      4. Waterfall Charts
      5. Surface Charts
  26. Chapter 16: Specialized 3D Charts
    1. Implementation
      1. 2D Chart Style
      2. Draw3DChart Class
    2. Color Charts on the X-Y Plane
      1. Implementation
      2. Testing X-Y Color Charts
    3. Contour Charts
      1. Algorithm
      2. Implementation
      3. Testing Contour Charts
    4. Combination Charts
      1. X-Y Charts in 3D
      2. Contour Charts in 3D
      3. Filled Contour Charts
      4. Mesh Contour Charts
      5. Surface Contour Charts
      6. Surface-Filled Contour Charts
    5. 3D Bar Charts
      1. Implementation
      2. Testing 3D Bar Charts
  27. Index

Product information

  • Title: Practical WPF Charts and Graphics
  • Author(s): Jack Xu
  • Release date: November 2009
  • Publisher(s): Apress
  • ISBN: 9781430224822