leo.cheung Posted September 20, 2019 Share Posted September 20, 2019 I have a Stacked Chart and want to display the value with percentage.This is the datasetThe Chart's label will become BLANK if using expression: String.valueOf((double)$F{cnt}/$F{total}) However if I change to String.valueOf((double)$F{cnt}/1000)It works, so how to field1 divide field2?It is so wried since this is very simple calculation and can be perform easily in SSRS or BIRT, but why so complicate in jasper report? Link to comment Share on other sites More sharing options...
C-Box Posted September 20, 2019 Share Posted September 20, 2019 Hava you already tried to limit the number of decimal places?So something like this:String.format ("%.2f", ($F{cnt}/$F{total}))[/code]?? Perhaps just the long string when dividing your numbers just doesn't fit into the bar chart elements?!?hth + regards C-Box 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