Getting Started with Windows Forms Bullet Graph
18 Jul 20246 minutes to read
The Bullet Graph is composed of quantitative scale, qualitative ranges, featured measure and Comparative Measure. The main purpose of the Bullet Graph is described by making use of the Caption. The quantitative scale of the Bullet Graph includes ticks and labels. The view of the Bullet Graph is changed by setting the Orientation property.
Assembly deployment
Refer control dependencies section to get the list of assemblies or NuGet package needs to be added as reference to use the control in any application.
Please find more details regarding how to install the nuget packages in windows form application in the below link:
Create the Bullet Graph Programmatically
- Assembly Information
Bullet Graph is available in the following assembly.
Assembly: Syncfusion.BulletGraph.Windows
- NameSpace
Bullet Graph is available in the following namespace.
Namespace: Syncfusion.Windows.Forms.BulletGraph
Steps to create a simple Bullet Graph control:
-
Create a new Windows Forms application project in Visual Studio.
- Add references to Syncfusion.BulletGraph.Windows.
-
Add the Bullet Graph control in code behind as follows.
BulletGraph bullet = new BulletGraph(); bullet.Dock = DockStyle.Fill; bullet.FlowDirection = BulletGraphFlowDirection.Forward; bullet.Orientation = Orientation.Horizontal; bullet.FeaturedMeasure = 4.5; bullet.ComparativeMeasure = 7; bullet.LabelFontSize = 10; bullet.LabelStroke = Color.Black; bullet.MajorTickStroke = Color.Black; bullet.Minimum = 0; bullet.Maximum = 10; bullet.Interval = 2; bullet.MinorTicksPerInterval = 3; bullet.QualitativeRanges.Add(new QualitativeRange() { RangeEnd = 4, RangeCaption = "Bad", RangeStroke = Color.Red }); bullet.QualitativeRanges.Add(new QualitativeRange() { RangeEnd = 7, RangeCaption = "Satisfactory", RangeStroke = Color.Yellow }); bullet.QualitativeRanges.Add(new QualitativeRange() { RangeEnd = 10, RangeCaption = "Good", RangeStroke = Color.Green }); this.Controls.Add(bullet);
-
Run the application to view the Bullet Graph.
Create the Bullet Graph using Syncfusion Reference Manager
Syncfusion Reference Manager is used to add Syncfusion Tools.
To add a Bullet Graph Control, refer the following steps:
-
Create a simple Windows Forms application using Visual Studio.
-
Right-Click on the Project and select SyncfusionReferenceManager.
-
The Syncfusion Reference Manager Wizard is opened as shown in the following screenshot.
-
Search for Bullet Graph using SearchBox and select Bullet Graph Control. Click on Done to add selected Bullet Graph Control.
-
The Bullet Graph assemblies are automatically added to the Project after Clicking OK
-
Add the following code example in code behind to create a simple Bullet Graph control.
BulletGraph bullet = new BulletGraph(); bullet.Dock = DockStyle.Fill; bullet.FlowDirection = BulletGraphFlowDirection.Forward; bullet.Orientation = Orientation.Horizontal; bullet.FeaturedMeasure = 4.5; bullet.ComparativeMeasure = 7; bullet.LabelFontSize = 10; bullet.LabelStroke = Color.Black; bullet.MajorTickStroke = Color.Black; bullet.Minimum = 0; bullet.Maximum = 10; bullet.Interval = 2; bullet.MinorTicksPerInterval = 3; bullet.QualitativeRanges.Add(new QualitativeRange() { RangeEnd = 4, RangeCaption = "Bad", RangeStroke = Color.Red }); bullet.QualitativeRanges.Add(new QualitativeRange() { RangeEnd = 7, RangeCaption = "Satisfactory", RangeStroke = Color.Yellow }); bullet.QualitativeRanges.Add(new QualitativeRange() { RangeEnd = 10, RangeCaption = "Good", RangeStroke = Color.Green }); this.Controls.Add(bullet);
-
The simple Bullet Graph control is created as shown in the following screenshot.
NOTE
1. The Syncfusion Reference Manager is available in versions 11.3.0.30 and later. It supports referencing assemblies from version 10.4.0.71 version to the current version.
2. The Syncfusion Reference Manager is used only in Visual Studio 2015 or higher.