The main data value is encoded by a length of the main bar in the middle of the chart, known as the Feature Measure
. This is also called as value Bar
. Also, if you want to display the target bar you should map the valueField
name from the dataSource.
<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>
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;
}
You can customize the shape of the feature bar or value bar using the type
property of the bullet chart. Feature bar contains Rect
and Dot
shapes. The default type of feature bar is Rect
.
<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>
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;
}
Using the valueBorder
property of the bullet chart, you can customize the border color
and width
of the feature bar.
<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>
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;
}
You can customize the fill color and height of the feature bar using the valueFill
and valueHeight
properties of the bullet chart.
<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>
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;
}