<div class="control-section" align='center'>
<ejs-accumulationchart id="container" title="Mobile Browser Statistics" animationComplete="animation">
<e-accumulation-series-collection>
<e-accumulation-series dataSource="ViewBag.dataSource" xName="xValue" yName="yValue" name="Revenue" innerRadius="40%">
<e-accumulationseries-datalabel template="#template" visible="true">
<e-font fontWeight="600" color="red"></e-font>
</e-accumulationseries-datalabel>
</e-accumulation-series>
</e-accumulation-series-collection>
</ejs-accumulationchart>
</div>
<script>
var centerTitle = document.createElement('div');
centerTitle.innerHTML = 'Expenses in Year';
centerTitle.style.position = 'absolute';
centerTitle.style.visibility = 'hidden';
var count = 0;
function animation(args) {
centerTitle.style.fontSize = getFontSize(args.accumulation.initialClipRect.width);
var rect = centerTitle.getBoundingClientRect();
centerTitle.style.top = (args.accumulation.origin.y - rect.height / 2) + 'px';
centerTitle.style.left = (args.accumulation.origin.x - rect.width / 2) + 'px';
centerTitle.style.visibility = 'visible';
let points = args.accumulation.visibleSeries[0].points;
for (var point of points) {
if (point.labelPosition === 'Outside' && point.labelVisible) {
var label = document.getElementById('container_datalabel_Series_0_text_' + point.index);
label.setAttribute('fill', 'black');
}
}
}
document.getElementById('container').appendChild(centerTitle);
</script>
<script id="template">
<div style="background:#f5f5f5; border: 1px solid black; padding: 3px 3px 3px 3px">
<div><i class="fa fa-bell" aria-hidden="true"></i></div>
</div>
</script>
}
} |
<ejs-accumulationchart id="container" title="Mobile Browser Statistics" width="80%" load="load" animationComplete="animation" resized="resized">
<e-accumulation-series-collection>
<e-accumulation-series dataSource="ViewBag.dataSource" xName="xValue" yName="yValue" name="Revenue" innerRadius="60%">
</e-accumulation-series>
</e-accumulation-series-collection>
</ejs-accumulationchart>
<script>
var resized = function (args) {
args.accumulation.refresh();
}
</script> |
Before resizing |
After resizing |
|
|