I wanted to render custom Point labels for my bar chart. There's no API in BarChartModel for that, so I used extender function in JS:
Code: Select all
<script>
function barExt() {
this.cfg.series = [
{pointLabels:{
show: true,
labels: #{summaryBean.barDataLabels}
}}];
</script>
Code: Select all
labels: ['8052 kg', '180 kg', '300 kg']
Code: Select all
TypeError: D[w] is undefined charts.js.xhtml:1:322399
Code: Select all
<script>
$(document).ready(function(){
var line1 = [14, 32, 41];
var plot3 = $.jqplot('chart3', [line1], {
title: 'Bar Chart with Point Labels',
seriesDefaults: {renderer: $.jqplot.BarRenderer},
series:[
{pointLabels:{
show: true,
labels:#{summaryBean.barDataLabels}
}}]
});
});
</script>
<div id="chart3"></div>
One "workaround" for that it to just use pure jqplot and feed it with data from bean as shown, but that would require some changes in underlying bean which I'd like to avoid.
Do you have any idea how to achieve custom point labels for bar chart?