Jump to content
We've recently updated our Privacy Statement, available here ×

AdHoc Pie Chart Adding Datalabels (AWS)


stegmann

Recommended Posts

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,                        dataLabels: { enabled: true },                        point: {                            events: {                                legendItemClick: HDM._getLegendItemClickHandler                            }                        }                    }                },                series: [],                labels: {                    items: []                }            });[/code]

 

I uploaded the file and restarted tomcat7. but there is no effect in the charts.

Any idea?
Thanks a lot,

Philipp

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

var result = _.extend(HDM.getGeneralOptions(extraOptions), {
                xAxis: {
                    categories: []
                },
                plotOptions: {
                    pie: {
                        slicedOffset: 0,
                        dataLabels: { enabled: true },
                        point: {
                            events: {
                                legendItemClick: HDM._getLegendItemClickHandler
                            }
                        }
                    }
                },
                series: [],
                labels: {
                    items: []
                }
            });

Link to comment
Share on other sites

  • 2 years later...

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:

http://community.jaspersoft.com/documentation/jasperreports-server-ultimate-guide/v561/customizing-javascript-files

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...