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.
<template>
<div>
<ejs-bulletchart id="bulletChart"
:dataSource="data"
valueField="value"
targetField="target"
:minimum="minimum"
:maximum="maximum"
:interval="interval"
title="Sales Rate"
categoryField="category"
>
<e-bullet-range-collection>
<e-bullet-range end="35" color="red"></e-bullet-range>
<e-bullet-range end="50" color="blue"></e-bullet-range>
<e-bullet-range end="100" color="green"></e-bullet-range>
</e-bullet-range-collection>
</ejs-bulletchart>
</div>
</template>
<script>
import Vue from 'vue';
import { BulletChartPlugin } from '@syncfusion/ej2-vue-charts';
Vue.use(BulletChartPlugin);
export default {
data () {
return {
data: [{ value: 55, target: 75, category: "Year 1" }],
minimum: 0, maximum: 100, interval: 20
}
}
}
</script>
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.
<template>
<div>
<ejs-bulletchart id="bulletChart"
:dataSource="data"
valueField="value"
targetField="target"
:minimum="minimum"
:maximum="maximum"
:interval="interval"
title="Sales Rate"
categoryField="category"
type="Dot"
>
<e-bullet-range-collection>
<e-bullet-range end="35" color="red"></e-bullet-range>
<e-bullet-range end="50" color="blue"></e-bullet-range>
<e-bullet-range end="100" color="green"></e-bullet-range>
</e-bullet-range-collection>
</ejs-bulletchart>
</div>
</template>
<script>
import Vue from 'vue';
import { BulletChartPlugin } from '@syncfusion/ej2-vue-charts';
Vue.use(BulletChartPlugin);
export default {
data () {
return {
data: [{ value: 55, target: 75, category: "Year 1" }],
minimum: 0, maximum: 100, interval: 20
}
}
}
</script>
Using the valueBorder
property of the bullet chart, you can customize the border color
and width
of the actual bar.
<template>
<div>
<ejs-bulletchart id="bulletChart"
:dataSource="data"
valueField="value"
targetField="target"
:minimum="minimum"
:maximum="maximum"
:interval="interval"
title="Sales Rate"
categoryField="category"
:valueBorder="valueBorder"
>
<e-bullet-range-collection>
<e-bullet-range end="35" color="red"></e-bullet-range>
<e-bullet-range end="50" color="blue"></e-bullet-range>
<e-bullet-range end="100" color="green"></e-bullet-range>
</e-bullet-range-collection>
</ejs-bulletchart>
</div>
</template>
<script>
import Vue from 'vue';
import { BulletChartPlugin } from '@syncfusion/ej2-vue-charts';
Vue.use(BulletChartPlugin);
export default {
data () {
return {
data: [{ value: 55, target: 75, category: "Year 1" }],
minimum: 0, maximum: 100, interval: 20, valueBorder: {
color: "red", width: 3
}
}
}
}
</script>
Customize the fill color and height of the actual bar using the valueFill
and valueHeight
properties of the bullet chart.
<template>
<div>
<ejs-bulletchart id="bulletChart"
:dataSource="data"
valueField="value"
targetField="target"
:minimum="minimum"
:maximum="maximum"
:interval="interval"
title="Sales Rate"
categoryField="category"
valueFill="blue"
valueHeight=15
>
<e-bullet-range-collection>
<e-bullet-range end="35" color="red"></e-bullet-range>
<e-bullet-range end="50" color="blue"></e-bullet-range>
<e-bullet-range end="100" color="green"></e-bullet-range>
</e-bullet-range-collection>
</ejs-bulletchart>
</div>
</template>
<script>
import Vue from 'vue';
import { BulletChartPlugin } from '@syncfusion/ej2-vue-charts';
Vue.use(BulletChartPlugin);
export default {
data () {
return {
data: [{ value: 55, target: 75, category: "Year 1" }],
minimum: 0, maximum: 100, interval: 20
}
}
}
</script>