veeresh.jayakumar Posted November 3, 2015 Share Posted November 3, 2015 i have created a barchart using the ad-hoc view in jasperReport_server .Currently the values display only when i hover the mouse over the barchart .i was wondering is it possible to display the value above the barchart at all times using jasperReport_server. i am new to this thing i really need an answer from the experts down here thanks to all in advance Link to comment Share on other sites More sharing options...
rajesh.sirsikar Posted November 3, 2015 Share Posted November 3, 2015 Hi Veeresh, Check my blog for the solutionhttp://www.rajeshsirsikar.com/display-total-on-each-column-of-stacked-bar-in-jaspersoft-direct-approach/Rajesh Sirsikar Link to comment Share on other sites More sharing options...
veeresh.jayakumar Posted November 4, 2015 Author Share Posted November 4, 2015 Hi Rajesh, I want to know is it is possible to do it on JapserReport_Sever itself rather than Jasper_Studio. Thanks Rajesh Link to comment Share on other sites More sharing options...
zh3ntil Posted November 5, 2015 Share Posted November 5, 2015 Yes, that's is posibble but you have to make couple of modifaction on some js file. First you need t change what scripts are used by jasperserver. Default is "optimized_scripts". You have to change it to "scripts" Open 'WEB-INFjs.config.properties' with a text editor and change 'javascript.optimize=true' to false. (needs restart application server after modification)Second, open datamapper js file (scriptsbower_componentsbi-reportsrcadhoccharthighchartsDataMapper.js) and find 'getCommonSeriesGeneralOptions' method.Add the bold part to that method and save it. getCommonSeriesGeneralOptions: function(extraOptions) { var doAxisSwap = HDM.doAxisSwap(extraOptions.chartState.chartType); var options = _.extend(HDM.getGeneralOptions(extraOptions), { xAxis: HDM.getXAxisOptions(doAxisSwap, extraOptions), yAxis: HDM.isDualOrMultiAxisChart(extraOptions.chartState.chartType) ? [] : HDM.getYAxisOptions(doAxisSwap, extraOptions), plotOptions: { series: { marker: { enabled: extraOptions.chartState.showDataPoints }, dataLabels: { enabled: true, formatter: function () { return Highcharts.numberFormat(this.y,2); //decimal point } }, tooltip: { dateTimeLabelFormats: extraOptions.isTimeSeries ? HDM.getDateTimeLabelFormats(extraOptions.chartState.timeSeriesCategorizerName) : undefined, xDateFormat: extraOptions.isTimeSeries ? HDM.getDateTimeTooltipFormats(extraOptions.chartState.timeSeriesCategorizerName) : undefined } } }, series: [], legend: HDM.getLegendOptions(extraOptions) }); if (HDM._isTooltipFollowPointerEnabled(extraOptions.chartState.chartType)) { options.tooltip.followPointer = true; } if (HDM.isDualOrMultiAxisChart(extraOptions.chartState.chartType) || HDM.isSpiderChart(extraOptions.chartState.chartType)) { options.tooltip.shared = true; } else { options.tooltip.shared = false; } return options; }, After modifications clear your browser cache and open an adhoc chart. You should see the datalabels if everything is OK :) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now