javascript - How to make ChartJS not cut off tooltips? -
i trying figure out how make chartjs not cut off it's tooltips, can't seem find config option fix this.
this have tried far:
<script> $(document).ready(function() { var doughnutdata = [ { value: 48.3, color: "#81d7d8", highlight: "#23c6c8", label: "accepted" }, { value: 20.7, color: "#f58894", highlight: "#d9534f", label: "denied" }, { value: 31, color: "#f5c592", highlight: "#f8ac59", label: "pending" } ]; var doughnutoptions = { segmentshowstroke: true, segmentstrokecolor: "#fff", segmentstrokewidth: 2, percentageinnercutout: 45, // 0 pie charts animationsteps: 100, animationeasing: "easeoutbounce", animaterotate: true, animatescale: false, fullwidth: true }; var ctx = document.getelementbyid("doughnutchart").getcontext("2d"); var doughnutchart = new chart(ctx).doughnut(doughnutdata, doughnutoptions); }); </script>
in html respective section looks this:
<div class="col-lg-3"> <div class="ibox float-e-margins"> <div class="ibox-content"> <canvas id="doughnutchart" width="95" height="95" style="width: 95px; height: 95px;"></canvas> </div> </div> </div>
anyone point me missing here?
since using legacy chart.js v1.x, don't have many possibilities in v2.x.
one simple way fix problem edit style of tooltips in options. won't change default 95px of height
, width
chart :
var doughnutoptions = { // ... fullwidth: true, tooltipfontsize: 10 };
and give this result.
Comments
Post a Comment