Contents
- Size for container
- Size for bullet chart
Having trouble getting help?
Contact Support
Contact Support
Bullet chart dimensions
24 Jun 20243 minutes to read
Size for container
The size of the Bullet Chart is determined by the container size, and it can be changed inline or via CSS as following.
@{
List<DefaultBulletData> bulletData = new List<DefaultBulletData>
{
new DefaultBulletData { value = 270, target = 250}
};
}
<ejs-bulletchart id="bulletgraph" width="600px" height="100px" minimum="0" maximum="300" interval="50" valueField="value" targetField="target" dataSource="bulletData">
<e-bullet-range-collection>
<e-bullet-range end="150"></e-bullet-range>
<e-bullet-range end="250"></e-bullet-range>
<e-bullet-range end="300"></e-bullet-range>
</e-bullet-range-collection>
</ejs-bulletchart>
...
public class DefaultBulletData
{
public double value;
public double target;
}
Size for bullet chart
The Width
and Height
properties are used to adjust the size of the Bullet Chart.
Pixel
Sets the size of the Bullet Chart in pixels as shown below.
@{
List<BulletData> bulletData = new List<BulletData>
{
new BulletData { value = 270, target = 250}
};
}
<ejs-bulletchart id="bulletgraph" width="600px" height="100px" minimum="0" maximum="300" interval="50" valueField="value" targetField="target" dataSource="bulletData">
<e-bullet-range-collection>
<e-bullet-range end="150"></e-bullet-range>
<e-bullet-range end="250"></e-bullet-range>
<e-bullet-range end="300"></e-bullet-range>
</e-bullet-range-collection>
</ejs-bulletchart>
...
public class BulletData
{
public double value;
public double target;
}
Percentage
By setting a value in percentage, the Bullet Chart gets its dimension with respect to its container. For example, when the height is 50%, the Bullet Chart renders to half of the container’s height.
@{
List<DefaultBulletChartData> bulletData = new List<DefaultBulletChartData>
{
new DefaultBulletChartData { value = 270, target = 250}
};
}
<ejs-bulletchart id="bulletgraph" width="80%" height="90%" minimum="0" maximum="300" interval="50" valueField="value" targetField="target" dataSource="bulletData">
<e-bullet-range-collection>
<e-bullet-range end="150"></e-bullet-range>
<e-bullet-range end="250"></e-bullet-range>
<e-bullet-range end="300"></e-bullet-range>
</e-bullet-range-collection>
</ejs-bulletchart>
...
public class DefaultBulletChartData
{
public double value;
public double target;
}
NOTE
If the size is not specified, the Bullet Chart will be rendered with a height of 126px and a width of the window.