I'm trying to render an angular-chart (based on chart.js) chart inside a bootstrap panel. Currently the chart does not swho at all when inside the panel but does show when placed outside the panel. When I view the source in the browser I see the height and width are set to zero.
chart does not display
<div class="panel-group" ng-model="experiments.active" role="tablist" aria-multiselectable="true" bs-collapse>
<div class="panel panel-default" ng-repeat="experiment in experiments">
<div class="panel-collapse" role="tabpanel" bs-collapse-target>
<div class="panel-body">
<canvas id="pie" class="chart chart-pie" data="viewCountData" labels="viewCountLabels" options="viewCountOptions" style="height: 50px; width: 50px"></canvas>
</div>
</div>
</div>
</div>
chart DOES display
<div class="panel-group" ng-model="experiments.active" role="tablist" aria-multiselectable="true" bs-collapse>
<div class="panel panel-default" ng-repeat="experiment in experiments">
<div class="panel-collapse" role="tabpanel" bs-collapse-target>
<div class="panel-body">
</div>
</div>
</div>
</div>
<canvas id="pie" class="chart chart-pie" data="viewCountData" labels="viewCountLabels" options="viewCountOptions" style="height: 50px; width: 50px"></canvas>
Page Source:
Not sure where or why the height and width are getting set to zero. I also have tried setting the height and width in css but still have had no luck.
.chart {
height: 400px;
width: 600px;
}
#pie {
height: 400px;
width: 600px;
}
I have also tried adjusting the chart options
viewCountOptions = {
responsive: false,
maintainAspectRatio: false
};