Hello,
using Jasperserver 5.6 on AWS.
I am trying to add DataLabels to the Piecharts in Ad-Hoc Editor
For this I changed scripts/adhoc/highchart.datamapper.js as following
var result = _.extend(HDM.getGeneralOptions(extraOptions), { xAxis: { categories: [] }, plotOptions: { pie: { slicedOffset: 0, <span style="background-color:#ffff00;"> dataLabels: { enabled: true },</span> point: { events: { legendItemClick: HDM._getLegendItemClickHandler } } } }, series: [], labels: { items: [] } });
I uploaded the file and restarted tomcat7. but there is no effect in the charts.
Any idea?
Thanks a lot,
Philipp
1 Answer:
Starting with version 6.2 you can use advanced properties to apply labels to pie charts. You need to use "series.dataLabels.enabled" and set it to true. You can also use "series.dataLabels.distance" to control positioning of the data labels.
Note that you need to use series.dataLabels... rather than plotOptions.pie.dataLabels... to apply properties to adhoc pie charts. You may try to use these properties in your dataMapper.js change. Also, if you use optimized version of scripts, you need either to add _opt=false parameter to the URL or re-compile optimized scripts after the changes as described in the doc:
var result = _.extend(HDM.getGeneralOptions(extraOptions), {
xAxis: {
categories: []
},
plotOptions: {
pie: {
slicedOffset: 0,
dataLabels: { enabled: true },
point: {
events: {
legendItemClick: HDM._getLegendItemClickHandler
}
}
}
},
series: [],
labels: {
items: []
}
});