Practical WPF Charts and Graphics -  Jack Xu

Practical WPF Charts and Graphics (eBook)

(Autor)

eBook Download: PDF
2010 | 1. Auflage
712 Seiten
Apress (Verlag)
978-1-4302-2482-2 (ISBN)
Systemvoraussetzungen
99,99 inkl. MwSt
  • Download sofort lieferbar
  • Zahlungsarten anzeigen

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.



A bio is not currently available for this author.
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.

A bio is not currently available for this author.

Title Page 1
Copyright Page 2
Contents at a Glance 4
Table of Contents 5
About the Author 16
Acknowledgments 17
Introduction 18
Overview 18
What This Book Includes 20
Is This Book for You? 20
What Do You Need to Use This Book? 21
How the Book Is Organized 21
Using Code Examples 23
Customer Support 23
CHAPTER 1 Overview of WPF Programming 24
New features in WPF 24
XAML Basics 25
Why Is XAML Needed? 25
Creating XAML Files 25
Code-Behind Files 26
Your First WPF Program 27
Properties in XAML 28
Event Handlers in Code-Behind Files 28
Code-Only Example 30
XAML-Only Example 32
CHAPTER 2 2D Transformations 34
Basics of Matrices and Transformations 34
Vectors and Points 34
Scaling 35
Reflection 36
Rotation 36
Translation 37
Homogeneous Coordinates 38
Translation in Homogeneous Coordinates 38
Scaling in Homogeneous Coordinates 39
Rotation in Homogeneous Coordinates 40
Combining Transforms 41
Vectors and Matrices in WPF 42
Vector Structure 42
Matrix Structure 44
Matrix Operations 45
Matrix Transforms 48
Creating Perpendicular Lines 54
Object Transformations in WPF 59
MatrixTransform Class 61
ScaleTransform Class 65
TranslateTransform Class 68
RotateTransform Class 71
SkewTransform Class 75
Composite Transforms 78
CHAPTER 3 WPF Graphics Basics in 2D 81
2D Coordinate Systems in WPF 81
Default Coordinates 81
Custom Coordinates 84
Custom Coordinates for 2D Charts 89
2D Viewport 94
Zooming and Panning 95
Resizable Canvas 98
Basic 2D Graphics Shapes in WPF 102
Lines 102
Rectangles and Ellipses 104
Polylines 108
Polygons 110
Paths and Geometries 113
Line, Rectangle, and Ellipse Geometries 114
GeometryGroup Class 115
CombinedGeometry Class 117
PathGeometry Class 120
Lines and Polylines 121
Arcs 121
Bezier Curves 122
Geometry and Mini-Language 124
Hit Testing 127
Custom Shapes 130
Star Class 130
ArrowLine Class 134
Testing Custom Shapes 139
CHAPTER 4 Colors and Brushes 144
Colors 144
System Colors 145
Color Picker 148
Brushes 155
SolidColorBrush 155
LinearGradientBrush 158
RadialGradientBrush 162
DrawingBrush 165
Custom Colormap and Shading 168
Custom Colormap Brushes 168
Testing Colormap Brushes 174
Color Shading 176
Testing Color Shading 180
CHAPTER 5 2D Line charts 183
Simple Line Charts 183
Creating Simple Line Charts 183
How It Works 186
Line Charts with Data Collection 186
Chart Style 186
Data Series 188
Data Collection 190
Creating Line Charts 191
Gridlines and Labels 194
Chart Style with Gridlines 194
Creating a Chart with Gridlines 199
Legends 203
Legend Class 203
Creating a Chart with a Legend 208
Symbols 212
Defining Symbols 212
Symbols Class 213
Creating a Chart with Symbols 220
Line Charts with Two Y Axes 223
Why We Need Two Y Axes 223
Chart Style with Two Y Axes 225
DataSeries and DataCollection with Two Y Axes 231
Creating a Chart with Two Y Axes 233
CHAPTER 6 Specialized 2D Charts 237
Bar Charts 237
DataSeries for Bar Charts 237
DataCollection for Bar Charts 238
Creating Simple Bar Charts 244
Creating Group Bar Charts 249
Creating Overlay Bar Charts 253
Creating Stacked Bar Charts 254
Stair-Step Charts 256
DataSeries for Stair-Step Charts 256
DataCollection for Stair-Step Charts 257
Creating Stair-Step Charts 258
Stem Charts 261
DataCollection for Stem Charts 261
Creating Stem Charts 262
Error Bar Charts 264
DataSeries for Error Bars 264
DataCollection for Error Bars 266
Creating Error Bar Charts 268
Area Charts 270
DataSeries for Area Charts 270
DataCollection for Area Charts 271
Creating Area Charts 273
Polar Charts 275
Chart Style for Polar Charts 275
DataCollection for Polar Charts 280
Creating Polar Charts 281
Pie Charts 285
Pie Chart Style 285
Legend for Pie Charts 288
Creating Pie Charts 289
CHAPTER 7 Stock Charts 294
Static Stock Charts 294
Text File Reader 294
DataSeries and DataCollection for Stock Charts 297
Hi-Lo Stock Charts 300
Hi-Lo Open-Close Stock Charts 304
Candlestick Stock Charts 305
Moving Averages 306
Simple Moving Averages 306
Implementation 307
Creating SMA Curves 309
Weighted Moving Averages 312
Implementation 312
Creating WMA Curves 314
Exponential Moving Averages 315
Implementation 316
Creating EMA Curves 318
Using Yahoo Stock Charts in WPF 319
Connecting to Yahoo Stock Charts 319
Creating Yahoo Stock Charts in WPF 321
CHAPTER 8 Interactive 2D Charts 323
Automatic Tick Placement 323
Optimal Tick Spacing 323
Creating Charts with Automatic Ticks 327
Chart Panning with a Mouse 331
Chart Zooming with a Mouse 335
Chart Zooming with a Mouse Wheel 340
Retrieving Chart Data 344
CHAPTER 9 2D Chart Controls 351
Line Chart Control 351
Defining Dependency Properties 353
Using the Line Chart Control 361
Creating a Simple Line Chart 361
Creating Multiple Line Charts 364
Specialized 2D Chart Control 368
Bar Chart Control 368
Implementation 368
Creating Bar Charts 370
Creating Multiple Bar Charts 373
Stair-Step Chart Control 379
Implementation 379
Creating Stair-Step Charts 382
Stem Chart Control 383
Implementation 383
Creating Stem Charts 385
Error Bar Control 387
Implementation 387
Creating Error Bar Charts 389
Area Chart Control 391
Implementation 391
Creating Area Charts 393
Polar Chart Control 395
Implementation 395
Creating Polar Charts 397
Pie Chart Control 399
Implementation 399
Creating Pie Charts 401
Creating Multiple Charts 403
CHAPTER 10 Data Interpolations 411
Linear Interpolation 411
Algorithm 411
Implementation 412
Testing Linear Interpolation 413
Lagrange Interpolation 416
Algorithm 416
Implementation 416
Testing Lagrange Interpolation 417
Barycentric Interpolation 419
Algorithm 420
Implementation 420
Testing Barycentric interpolation 421
Newton Divided-Difference Interpolation 424
Algorithm 424
Implementation 426
Testing Newton Divided-Difference Interpolation 427
Cubic Spline Interpolation 429
Algorithm 430
Implementation 430
Testing Cubic Spline Interpolation 433
CHAPTER 11 Curve Fitting 436
Linear Algebraic Equations 436
Gauss-Jordan Algorithm 437
Implementation 437
Least-Squares Fit 439
Straight-Line Fit 440
Implementation 440
Testing Straight-Line Fit 441
Linear Regression 444
Implementation 444
Testing Linear Regression 446
Polynomial Fit 450
Implementation 450
Testing Polynomial Fit 451
Weighted Linear Regression 454
Implementation 455
Exponential-Function Fit 456
CHAPTER 12 3D Transformations 461
3D Matrices in WPF 461
3D Points and Vectors 461
Matrix3D Structure 464
Matrix3D Operations 465
Matrix3D Transforms 469
Rotation and Quaternion 472
Projections 475
Orthographic Projections 476
Multiview Projections 476
Axonometric Projections 477
Isometric Projections 478
Dimetric Projections 478
Trimetric Projections 479
Perspective Projections 479
One-Point Perspective Projections 480
Two-Point Perspective Projections 481
Three-Point Perspective Projections 482
Perspective Projection Matrix 482
Views and Projections in WPF 483
View Transform 484
Perspective Projection 486
View Frustum 486
Perspective Transform Matrix 487
Implementing Perspective Transforms 490
Testing Perspective Projections 491
Orthographic Projection 495
Orthographic Transform Matrix 496
Implementing Orthographic Transforms 498
Testing Orthographic Projections 498
Object Transforms in WPF 500
ScaleTransform3D Class 501
TranslateTransform3D class 505
RotateTransform3D Class 507
MatrixTransform3D Class 509
Combining Transforms 512
CHAPTER 13 WPF Graphics Basics in 3D 514
3D Graphics Basics 514
Viewport3D 515
3D Objects in WPF 515
Geometry and Mesh 516
GeometryModel3D and Surfaces 518
Illuminating the Scene 519
Camera Position 520
Simple Triangle in 3D 521
Basic 3D Shapes 523
Coordinate Axes and Wireframe 523
Creating a Cube 525
Creating a Sphere 530
Creating a Cylinder 533
Creating a Cone 538
Creating a Torus 541
CHAPTER 14 3D Charts with the WPF 3D Engine 545
Simple Surfaces 545
Rectangular Meshes 545
SimpleSurface Class 547
Creating Simple Surfaces 550
Parametric Surfaces 555
Extruded Surfaces 565
Creating Extruded Surfaces 568
ParametricSurface Class 555
Creating Parametric Surfaces 559
Helicoid Surface 559
Sphere Surface 561
Torus Surface 562
Quadric Surfaces 563
Surfaces of Revolution 570
RotateSurface Class 571
Creating Surfaces of Revolution 575
Surface Shading 577
SurfaceShading Class 577
Creating Shaded Surfaces 581
CHAPTER 15 3D Charts Without the WPF3D Engine 585
3D Coordinate System 585
Azimuth and Elevation View 585
Creating a Cube 587
Chart Style in 3D 592
3D Coordinate Axes 598
Gridlines 603
Labels 606
Testing the Project 613
3D Line Charts 615
Implementation 615
Testing the Project 618
3D Surface Charts 620
Implementation 620
DataSeries Class 620
Chart Functions 622
DrawSurfaceChart Class 624
Mesh Charts 628
Curtain Charts 633
Waterfall Charts 637
Surface Charts 640
CHAPTER 16 Specialized 3D Charts 646
Implementation 646
2D Chart Style 646
Draw3DChart Class 651
Color Charts on the X-Y Plane 654
Implementation 654
Testing X-Y Color Charts 657
Contour Charts 660
Algorithm 660
Implementation 661
Testing Contour Charts 665
Combination Charts 667
X-Y Charts in 3D 667
Contour Charts in 3D 668
Filled Contour Charts 672
Mesh Contour Charts 673
Surface Contour Charts 675
Surface-Filled Contour Charts 676
3D Bar Charts 676
Implementation 677
Testing 3D Bar Charts 683
Index 686

Erscheint lt. Verlag 11.8.2010
Zusatzinfo 712 p.
Verlagsort Berkeley
Sprache englisch
Themenwelt Informatik Programmiersprachen / -werkzeuge NET Programmierung
Mathematik / Informatik Informatik Software Entwicklung
Mathematik / Informatik Informatik Theorie / Studium
Schlagworte Animation • C# • Computer • Control • programming • Windows Presentation Foundation
ISBN-10 1-4302-2482-7 / 1430224827
ISBN-13 978-1-4302-2482-2 / 9781430224822
Haben Sie eine Frage zum Produkt?
PDFPDF (Wasserzeichen)
Größe: 8,7 MB

DRM: Digitales Wasserzeichen
Dieses eBook enthält ein digitales Wasser­zeichen und ist damit für Sie persona­lisiert. Bei einer missbräuch­lichen Weiter­gabe des eBooks an Dritte ist eine Rück­ver­folgung an die Quelle möglich.

Dateiformat: PDF (Portable Document Format)
Mit einem festen Seiten­layout eignet sich die PDF besonders für Fach­bücher mit Spalten, Tabellen und Abbild­ungen. Eine PDF kann auf fast allen Geräten ange­zeigt werden, ist aber für kleine Displays (Smart­phone, eReader) nur einge­schränkt geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür einen PDF-Viewer - z.B. den Adobe Reader oder Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür einen PDF-Viewer - z.B. die kostenlose Adobe Digital Editions-App.

Zusätzliches Feature: Online Lesen
Dieses eBook können Sie zusätzlich zum Download auch online im Webbrowser lesen.

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

Mehr entdecken
aus dem Bereich
Expert-backed advice for information system design, down to .NET and …

von Jean-Philippe Gouigoux

eBook Download (2024)
Packt Publishing (Verlag)
38,39
Build practical projects with Blazor, .NET MAUI, gRPC, GraphQL, and …

von Mark J. Price

eBook Download (2023)
Packt Publishing Limited (Verlag)
35,99