Labels in WPF Bullet Graph (SfBulletGraph)

18 Oct 20222 minutes to read

A quantitative scale label specifies the numeric value according to the major ticks in the range of the scale.

Customizing Labels

The labels can be positioned far away from the quantitative scale by using the LabelOffset property and the default value of this is 0. The foreground of the label is customized by setting LabelStroke. By setting LabelSize, the font size of the labels is modified. The label content can be formatted by using LabelFormat property.

<syncfusion:SfBulletGraph  LabelSize="20" Minimum="0" Maximum="10"
                              LabelOffset="5"  Interval="2"
                              LabelStroke="Red"
                              LabelFormat="C" >
        </syncfusion:SfBulletGraph>
SfBulletGraph bulletgraph = new SfBulletGraph();
            bulletgraph.LabelOffset = 5;
            bulletgraph.LabelSize = 20;
            bulletgraph.LabelFormat = "C";
            bulletgraph.Minimum = 0;
            bulletgraph.Maximum = 10;
            bulletgraph.Interval = 2;
            bulletgraph.LabelStroke = new SolidColorBrush(Colors.Red);
            grid.Children.Add(bulletgraph);

Labels_img1

Label Position

The labels in the scale can be placed above or below the qualitative ranges by choosing the following options available in the LabelPosition property.

  1. Below (Default)
  2. Above

    <syncfusion:SfBulletGraph LabelPosition="Above" TickPosition="Cross">
            </syncfusion:SfBulletGraph>
    SfBulletGraph bulletgraph = new SfBulletGraph();
        bulletgraph.LabelPosition = BulletGraphLabelsPosition.Above;
        this.Grid.Children.Add(bulletgraph);

Labels_img2