ComponentOne BulletGraph for WinForms
C1.Win.C1Gauge Namespace / C1BulletGraph Class
Members

In This Topic
    C1BulletGraph Class
    In This Topic
    Control that shows a bullet graph.
    Object Model
    C1BulletGraph Class
    Syntax
    'Declaration
     
    Public Class C1BulletGraph 
       Inherits System.Windows.Forms.Control
    public class C1BulletGraph : System.Windows.Forms.Control 
    Remarks

    The C1BulletGraph class helps you to initialize an instance of the BulletGraph control and define its behavior with the help of the following properties:

    • Set the values of the featured measure (primary metric that is displayed by a bullet graph for example, year-to-date revenue) and comparative measure (metric against which the featured measure is compared, for example, target revenue) using the Value and Target properties.
    • Display the value of the featured measure as text in the bullet graph using the ShowValue property.
    • Customize the range of the quantitative scale of the BulletGraph using the Minimum and Maximum properties.
    • By default, the bar which is used to encode the featured measure begins from the minimum value of the scale. However, to start the bar from a different value, you can use the Origin property.
    • Change the default orientation i.e. horizontal to vertical or viceversa using the Orientation property.
    • Specify additional properties of the quantitative scale such as the scale labels interval, tick marks interval, scale labels formatting and scale labels/ tick marks visibility using the GraphScale property. This property is of the type BulletGraphScale class.
    • Show the scale values of the BulletGraph in reversed order (i.e from maximum to minimum) using the IsReversed property.
    • Define the ranges to measure the degree of performance for the featured measure using the Good and Bad properties. These properties are of the type BulletGraphRange class. The remaining range is considered best/most favourable for the featured measure and is encoded by a rectangle of lightest color intensity.
    • Add and customize the caption (i.e the caption’s text, alignment, position, height and width) for the BulletGraph control using the Caption property. This property is of the type BulletGraphCaption class.
    • Customize the appearance of the BulletGraph control and the different visual elements it is composed of such as labels, marks and ranges with the help of the Styles property. This property is of the type BulletGraphTheme class.
    • Save the BulletGraph as an image using the GetImage method and its overloads.
    Example

    The example instantiates the object of C1BulletGraph and shows the basic implementation with various options mentioned above.

    C#
    Copy Code
    private void InitializeBulletGraph()
            {
                //Initialize the BulletGraph control
                C1BulletGraph c1BulletGraph = new C1BulletGraph();
                c1BulletGraph.Bounds = new Rectangle(20,50,350,80);
                this.Controls.Add(c1BulletGraph);
    
                //Sets the values of the featured measure and comparative measure for the BulletGraph
                c1BulletGraph.Value = 450;
                c1BulletGraph.Target = 400;
    
                //Defines the range of the quantitative scale 
                c1BulletGraph.Minimum = 0;
                c1BulletGraph.Maximum = 500;
    
                //Sets additional properties of the quantitative scale 
                c1BulletGraph.GraphScale.LabelsInterval = 100;
                c1BulletGraph.GraphScale.MarksInterval = 100;
                c1BulletGraph.GraphScale.Format = "$###0";           
    
                //Defines the qualitative ranges for the Bullet Graph
                c1BulletGraph.Bad.From =0;
                c1BulletGraph.Bad.To = 150;
                c1BulletGraph.Good.From =150;
                c1BulletGraph.Good.To = 350;
    
                //Customizes the BulletGraph Caption
                c1BulletGraph.Caption.Text = "Revenue YTD ($1000s)";
                c1BulletGraph.Caption.Position = BulletGraphCaptionPosition.Left;
                c1BulletGraph.Caption.Alignment = StringAlignment.Far;
                c1BulletGraph.Caption.Width =120;
    
                //Orients the BulletGraph horizontally
                c1BulletGraph.Orientation = C1GaugeOrientation.Horizontal;
    
                //Shows the scale values in reversed order (Maximum to Minimum)
                c1BulletGraph.IsReversed = true;
    
                //Styling the BulletGraph
                c1BulletGraph.Styles.Labels.Caption.Font= new Font(FontFamily.GenericSansSerif,10);
                c1BulletGraph.Styles.Marks.Scale.Color = Color.Blue;
            }
    
    Inheritance Hierarchy

    System.Object
       System.MarshalByRefObject
          System.ComponentModel.Component
             System.Windows.Forms.Control
                C1.Win.C1Gauge.C1BulletGraph

    See Also