I need to show labels on my pie chart. I'm using:
ManagedBean
Code: Select all
pieModelLinha = new PieChartModel();
pieModelLinha.setLegendPosition("ne");
pieModelLinha.setShowDataLabels(true);
pieModelLinha.setExtender("skinPie");
Code: Select all
<script type="text/javascript">
function skinPie() {
this.cfg.shadow = false;
this.cfg.showDataLabels = true;
this.cfg.title = '';
this.cfg.seriesColors = ['#00acac', '#2f8ee5', '#efa64c', '#6c76af'];
this.cfg.grid = {
background: '#ffffff',
borderColor: '#ffffff',
gridLineColor: '#F5F5F5',
shadow: false
};
this.cfg.axesDefaults = {
rendererOptions: {
textColor: '#666F77',
}
};
this.cfg.seriesDefaults = {
renderer: $.jqplot.PieRenderer,
shadow: false,
lineWidth: 1,
markerOptions: {
shadow: false,
size: 7,
style: 'circle'
}
}
}
</script>
...
<div class="ui-g-12 ui-lg-6">
<div class="card">
<p:chart id="pie" type="pie" model="#{cacBean.pieModelLinha}" responsive="true" />
</div>
</div>