Search results

Actual Bar in ASP.NET Core Bullet Chart control

26 Nov 2021 / 2 minutes to read

To display the primary data or the current value of the data being measured known as the Feature Measure that should be encoded as a bar. This is called as the Actual Bar or the Feature Bar in the Bullet Chart, and to display the actual bar the valueField should be mapped to the appropriate field from the data source.

tagHelper
value-bar.cs
Copied to clipboard
<ejs-bulletchart id="bulletgraph" title="'Sales Rate" minimum="0" maximum="100" interval="20" valueField="value" dataSource="ViewBag.dataSource">
        <e-bullet-range-collection>
            <e-bullet-range end="35"></e-bullet-range>
            <e-bullet-range end="50"></e-bullet-range>
            <e-bullet-range end="100"></e-bullet-range>
        </e-bullet-range-collection>
</ejs-bulletchart>
Copied to clipboard
public IActionResult Index()
        {
            List<DefaultBulletData> bulletData = new List<DefaultBulletData>
            {
                new DefaultBulletData { value = 55, target = 75}     
            };
            ViewBag.dataSource = bulletData;
            return View();
        }
        public class DefaultBulletData
        {           
            public double value;
            public double target;
        }

Actual Bar in Bullet Chart

Types of Actual Bar

The shape of the actual bar can be customized using the type property of the Bullet Chart. The actual bar contains Rect and Dot shapes. By default, the actual bar shape is Rect.

tagHelper
types.cs
Copied to clipboard
<ejs-bulletchart id="bulletgraph" title="'Sales Rate" type="@Syncfusion.EJ2.Charts.Type.Dot" minimum="0" maximum="100" interval="20" valueField="value" dataSource="ViewBag.dataSource">
        <e-bullet-range-collection>
            <e-bullet-range end="35"></e-bullet-range>
            <e-bullet-range end="50"></e-bullet-range>
            <e-bullet-range end="100"></e-bullet-range>
        </e-bullet-range-collection>
</ejs-bulletchart>
Copied to clipboard
public IActionResult Index()
        {
            List<DefaultBulletData> bulletData = new List<DefaultBulletData>
            {
                new DefaultBulletData { value = 55, target = 75}     
            };
            ViewBag.dataSource = bulletData;
            return View();
        }
        public class DefaultBulletData
        {           
            public double value;
            public double target;
        }

Bullet Chart with Dot Actual Bar

Actual Bar Customization

Border Customization

Using the valueBorder property of the bullet chart, you can customize the border color and width of the actual bar.

tagHelper
value-border.cs
Copied to clipboard
<ejs-bulletchart id="bulletgraph" title="'Sales Rate" minimum="0" maximum="100" interval="20" valueField="value" dataSource="ViewBag.dataSource">
        <e-bullet-range-collection>
            <e-bullet-range end="35"></e-bullet-range>
            <e-bullet-range end="50"></e-bullet-range>
            <e-bullet-range end="100"></e-bullet-range>
        </e-bullet-range-collection>
        <e-bulletchart-valueborder width="3" color="red"></e-bulletchart-valueborder>
</ejs-bulletchart>
Copied to clipboard
public IActionResult Index()
        {
            List<DefaultBulletData> bulletData = new List<DefaultBulletData>
            {
                new DefaultBulletData { value = 55, target = 75}     
            };
            ViewBag.dataSource = bulletData;
            return View();
        }
        public class DefaultBulletData
        {           
            public double value;
            public double target;
        }

Fill color and height Customization

Customize the fill color and height of the actual bar using the valueFill and valueHeight properties of the bullet chart.

tagHelper
value-fill.cs
Copied to clipboard
<ejs-bulletchart id="bulletgraph" title="'Sales Rate" valueFill="blue" valueHeight="15" minimum="0" maximum="100" interval="20" valueField="value" dataSource="ViewBag.dataSource">
        <e-bullet-range-collection>
            <e-bullet-range end="35"></e-bullet-range>
            <e-bullet-range end="50"></e-bullet-range>
            <e-bullet-range end="100"></e-bullet-range>
        </e-bullet-range-collection>
</ejs-bulletchart>
Copied to clipboard
public IActionResult Index()
        {
            List<DefaultBulletData> bulletData = new List<DefaultBulletData>
            {
                new DefaultBulletData { value = 55, target = 75}     
            };
            ViewBag.dataSource = bulletData;
            return View();
        }
        public class DefaultBulletData
        {           
            public double value;
            public double target;
        }

Customizing Actual Bar in Bullet Chart