Jump to content

Pie/Doughnut Chart From Two Values


philip.deuchler
Go to solution Solved by ilona,

Recommended Posts

I have two values, both java.lang.Long, and I need to create either a Pie or a Doughnut chart from these two values. These are aggregate values (stored in variables) taken over the entire report, and thus have no series associated with them. All I need is to display a chart showing a large slice for the big number, and a small slice for the small number. I have already easily accomplished this with the classic JFreeChart pie chart, but cannot accomplish it with the HTML5 pie chart (I am only allowed a single expression for the value entry). Upon attempting to use Charts Pro pie/doughnut charts each value is automagically split into 33 different slices, apparently forcing the static values to appear to be a series, and I cannot find the option to fix this.

Delivering an interative report that allows customers to break down their data in every single chart except the pie chart is going to look a little silly, is there any help you can give me to accomplish this task using either HTML5 charts or Charts Pro?

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

I think the best option in spirito of using JasperReports is to use JavaBeans to pass values to HTML5. Something like done in the following page:

http://www.tutorialspoint.com/jasper_reports/jasper_report_scriptlets.htm

Another option is to embedded JasperReports report in a html page and execute a jQuery from the main page to execute chart.series[0].setData() method but this isn't very good because you'll be tempering data output from JasperReports.

chart.series[0].setData( [/code]
chart.series[0].setData( [/code]
chart.series[0].setData( [/code]
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...