WPF-Diagramm-Lernprogramm VS2022 - VS2019

point 1
symbol 2

VS2022 - VS2019 WPF CHART COMPONENT Net4.8 Framework C# Walk Through

ProEssentials WPF Charting interfaces are used when creating stand-alone client-side EXEs to be distributed and ran on an end-users machine. This VS2022 - VS2019 WPF Net4.8 Framework C# Charting Walk-through includes instructions for Visual Studio VS2022 - VS2019. Click here for Net60 Nuget Charting Click here for Net4.8 VS2015-VS2012

Siehe die Demo...
Best WPF Chart to download, evaluate, and choose for your Financial Scientific Charting.
Best .NET Chart download for Scientific Charting, Engineering Charting.
Hello World - Walk-Through - Tutorial

It is recommended that the namespace: Gigasoft.ProEssentials.Enums be included at the top of your source code files utilizing ProEssentials. In C#, use the using keyword. For example:

using Gigasoft.ProEssentials.Enums;

The following information demonstrates how to create your first .NET WPF Charting ProEssentials implementation using the C# language. It discusses using the Wpf interfaces to add interactive scientific charting content to your EXEs. See the other charting examples provided within the product/evaluation.

Creating a new project...

1) Start Visual Studio.NET and create a new project targeting [C#] [Windows] [Desktop] and [WPF .Net Framework]. Accept the default name of [WpfApp1]. Note to make sure this project type is set to .NET FrameWork; if not then project may be expecting our Net60 assemblies. We optionally have assemblies for Net60 (Windows) but these are installed via Nuget package via Package Manager and adjusting Package Source to [ Gigasoft (Local) ] or searching for "Gigasoft" if installing from Nuget.org.

Wpf charting new project C# 2019

2) When the new project opens, you will be presented the design view of "MainWindow.xaml and MainWindow.xaml.cs".

WPF Chart control walkthrough in Visual Studio vs2019
Adding ProEssentials WPF Charts to your Toolbox...

3) Installing WPF Chart interfaces into Visual Studio.NET

VS2022 - VS2019 Instructions

  • Note 1. For VS2022 we recommend our x64 assembly else the first time our AnyCpu WPF assembly is added to the IDE Toolbar and a chart is added to a window, it is recommended Visual Studio be running with Admin privileges. Subsequent use will not require Admin.
  • 1. With the Designer window having focus, Click the [Toolbox] vertical tab,
  • 2. Right Click the area below the [General] tab,
  • 3. Select [Add Tab],
  • 4. Enter [Gigasoft Wpf] for the tab's name,
  • 5. Right Click the area below new [Gigasoft Wpf] tab,
  • 6. Select [Choose Items...],
  • 7. If not selected, left click the [.NET Framework Components] tab,
  • 8. Left click the [Browse...] button and find the file "Gigasoft.ProEssentialsWpf.dll" found in our \DotNet48\AnyCpu or \DotNet48\x64 subfolder where you installed ProEssentials. By default, this is located at "C:\ProEssentials9\DotNet48\AnyCpu\",
  • 9. Select the file "Gigasoft.ProEssentialsWpf.dll" and close the [Open File] dialog,
  • 10. The [Choose Toolbox Items] dialog should now show 5 highlighted controls: Pe3do, Pego, Pepco, Pepso, and Pesgo.
  • 11. Close dialog and 5 ProEssentials components will show within the Gigasoft tab as shown in the bottom right image.
  • Note 2. Attemping to add our x64 assembly located in \DotNet48\x64\ to VS2019 and earlier toolbox will result in an error as the VS2019 designer is 32 bit. Similarly attemping to add our x86 assembly located in \DotNet48\x86 to VS2022 toolbox will result in an error as the VS2022 designer is 64 bit.
  • Note 3. When deploying your finished project and prefer to change the target to x64 or x86, close the Designer window, in Solution Explorer remove our Reference and replace with any of our other assemblies. The project will now support compiling as x64, x86, or AnyCpu that matches the Reference added. To again add our charts to a form via the Designer, change Reference to our AnyCpu assembly.

net charting components in vs2022 VS2019 toolbar
.Net charting components in vs2022 vs2019 toolbar
Adding a ProEssentials WPF Chart to an XAML Window...

4) Following the image below, Right click the [PegoWpf] tool within the toolbox and select [Copy]. Move your text cursor within the text view of MainWindow.xaml.cs between the <Grid > and </Grid> tags and right click and [Paste]. * Note, use the Build menu, Rebuild project to allow the IDE to compile all that is necessary to see the chart in the Designer window.

WPF Chart control in Visual Studio vs2022 vs2019
C# WPF Chart property Window in VS2022 VS2019

This represents the default state of a ProEssentials Graph. The default state has one subset with four data points. In the course of constructing your own charts, you'll set the properties PeData.Subsets and PeData.Points which define the quantity of data your chart will hold. You'll then pass data via the PeData.Y[subset, point] two dimensional property array. The following section shows example code of passing data.

ProEssentials uses the terms Subsets and Points but you can think of these as Rows and Columns. Passing data is as simple as filling each Subset with Points worth of data.

MainWindow.xaml.cs [Code]...

6) After embedding the chart in your window, edit the PegoWpf tag by deleting the Height and Width items, place the cursor within white space inside the PegoWpf tag and type "Name=" and provide a name for your chart like "Pego1" and then type "Loaded=" and accept the default loaded event and right click and select "Go to Definition" to navigate to Event Handler. Your xaml should look like...
WPF Chart property Window in VS2019 C#

You can copy and paste, but hand-typing a few lines of this code will help familiarize yourself with the Gigasoft.ProEssentials namespace.  

Note: adding the following usingdeclaration at the top of "Form1.cs" will shorten enumeration syntax.

using Gigasoft.ProEssentials.Enums;

// Simple to code = simple to implement and maintain //

Pego1.PeString.MainTitle = "Hello World";
Pego1.PeString.SubTitle = "";

Pego1.PeData.Subsets = 2; // Subsets = Rows //
Pego1.PeData.Points = 6; // Points = Columns //
Pego1.PeData.Y[0, 0] = 10; Pego1.PeData.Y[0, 1] = 30;
Pego1.PeData.Y[0, 2] = 20; Pego1.PeData.Y[0, 3] = 40;
Pego1.PeData.Y[0, 4] = 30; Pego1.PeData.Y[0, 5] = 50;
Pego1.PeData.Y[1, 0] = 15; Pego1.PeData.Y[1, 1] = 63;
Pego1.PeData.Y[1, 2] = 74; Pego1.PeData.Y[1, 3] = 54;
Pego1.PeData.Y[1, 4] = 25; Pego1.PeData.Y[1, 5] = 34;

Pego1.PeString.PointLabels[0] = "Jan";
Pego1.PeString.PointLabels[1] = "Feb";
Pego1.PeString.PointLabels[2] = "Mar";
Pego1.PeString.PointLabels[3] = "Apr";
Pego1.PeString.PointLabels[4] = "May";
Pego1.PeString.PointLabels[5] = "June";

Pego1.PeString.SubsetLabels[0] = "For .Net Framework";
Pego1.PeString.SubsetLabels[1] = "or MFC, ActiveX, VCL";
Pego1.PeString.YAxisLabel = "Simple Quality Rendering";

Pego1.PeColor.SubsetColors[0] = Color.FromArgb(60, 0, 180, 0);
Pego1.PeColor.SubsetColors[1] = Color.FromArgb(180, 0, 0, 130);

Pego1.PeColor.BitmapGradientMode = false;
Pego1.PeColor.QuickStyle = Gigasoft.ProEssentials.Enums.QuickStyle.LightShadow;
Pego1.PeTable.Show = Gigasoft.ProEssentials.Enums.GraphPlusTable.Both;
Pego1.PeData.Precision = Gigasoft.ProEssentials.Enums.DataPrecision.NoDecimals;
Pego1.PeFont.Label.Bold = true;
Pego1.PePlot.Method = Gigasoft.ProEssentials.Enums.GraphPlottingMethod.Bar;
Pego1.PePlot.Option.GradientBars = 8;
Pego1.PePlot.Option.BarGlassEffect = true;
Pego1.PeLegend.Location = Gigasoft.ProEssentials.Enums.LegendLocation.Left;
Pego1.PePlot.DataShadows = Gigasoft.ProEssentials.Enums.DataShadows.ThreeDimensional;
Pego1.PeFont.FontSize = Gigasoft.ProEssentials.Enums.FontSize.Large;
Pego1.PePlot.SubsetLineTypes[0] = Gigasoft.ProEssentials.Enums.LineType.MediumSolid;
Pego1.PePlot.SubsetLineTypes[1] = Gigasoft.ProEssentials.Enums.LineType.MediumDash;

// This enables data hot spots, But we need to define code in the HotSpot event //
Pego1.PeUserInterface.HotSpot.Data = true;

// These settings will be used for all charts //

Pego1.PeConfigure.RenderEngine = Gigasoft.ProEssentials.Enums.RenderEngine.Direct2D;
Pego1.PeConfigure.AntiAliasGraphics = true;
Pego1.PeConfigure.AntiAliasText = true;
// Call these at end of setting properties //
Pego1.Chart.UpdateLayout(); // this is only needed within initial Loaded event //

Your project code should look similar to...

WPF C#.NET Chart code window for form load event vs2019
Adding a DataHotSpot event...

7) The code above enabled the DataHotSpot event, so we should place some appropriate code in the DataHotSpot event.

Again place cursor within the PegoWpf tag and type "PeDataHotSpot=" and accept the default event and right click and select "Go to Definition" to navigate to Event Handler.

Or, Left click the PegoWpf control within designer window to give it the focus.

From the main menu select [View] and [Properties Window]

Within the [Properties Window], click the event icon.

Within the available events, double-click PeDataHotSpot edit box.

Chart WPF event window for HotSpot event vs2019
WPF Chart hot spot tag event vs2019

Add the following code to the pego1_PeDataHotSpot event.

System.Windows.MessageBox.Show("Subset " + e.SubsetIndex.ToString() + ", Point " + e.PointIndex.ToString() + " with a value of " + Pego1.PeData.Y[e.SubsetIndex, e.PointIndex].ToString());


8) Save and run the project. Your project will show an image as follows. Move the mouse over a bar and click to trigger the DataHotSpot event.

This completes this walkthrough.

Please read the remaining sections within Chapter 2 and review the demo code and documentation that's installed with the eval/product.

Once installed, the demo program can be accessed via shortcut...

Start / ProEssentials v9 / PeDemo

Note that our main charting demo is replicated in WPF and Winform C#.NET,  VB.NET, VC++ MFC, Delphi, Builder all accessible from where you installed ProEssentials.   These are great for modifying an existing demo to test potential modifications before implementing within your applications.

WPF Chart within your software!

Thank you for researching. Please contact our engineers if you have a question.

WPF Chart Component Scientific Financial Fast Robust

Unsere Aufgabe

Ihr Erfolg ist unser höchstes Ziel, indem wir Ihrem Unternehmen und Ihren Endbenutzern den einfachsten und professionellsten Nutzen bieten.

Wir sind Ingenieure

ProEssentials wurde von professionellen Elektroingenieuren erschaffen, die ihre eigenen Charting-Komponenten benötigten. Treten Sie unserer großen Liste von Top-Engineering-Unternehmen bei, die ProEssentials einsetzen.

Danke sehr

Vielen Dank, dass Sie ein ProEssentials-Kunde sind, und vielen Dank, dass Sie die ProEssentials-Charting-Engine recherchieren.