Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Chart export to bitmap (PNG, PDF, TIFF, JPG) #167

merged 10 commits into from Jan 17, 2013


None yet
2 participants

nurkiewicz commented Jan 17, 2013

I implemented chart export functionality. It consists of client-side support (converting chart to SVG and posting it to the server) and a servlet in saiku that receives SVG (XML) and returns binary representation. Conversion is backed by batik library, thus it supports PNG, PDF (exported in vector format, high quality zoom available), TIFF or JPG. Also we can download SVG file as-is.

Unfortunately server-side component was required (you may wish to port servlet to REST service). Hidden form is used to make sure all files pop-up with browser's Save... dialog rather than replacing current page with image.

Known issues:

  • doesn't work on Google Chrome. Most likely some JavaScript issue.

This pull request contains all commits (first 8) from Multiple chart fixes. Last two implement the actual export on the client side.

See also

Chart export (server-side support) for server side support.


pstoellberger commented Jan 17, 2013

i was wondering if you could do the check + counter stuff within the first pass of the resultset as well?
e.g. the first item doesn't have a counter on it, the second will look like "item 1"

i have bad experience introducing several pass algorithms

appreciate this pull request though!

pstoellberger added a commit that referenced this pull request Jan 17, 2013

Merge pull request #167 from nurkiewicz/chart-export
Chart export to bitmap (PNG, PDF, TIFF, JPG)

@pstoellberger pstoellberger merged commit d843b1d into OSBI:master Jan 17, 2013


pstoellberger commented Jan 17, 2013

when an export fails the UI is forwarded to an error page, maybe this can be handled better?
for the excel export i use window.open() so it wont affect the currently open UI state in case something goes wrong

maybe you have an idea for that!?


nurkiewicz commented Jan 17, 2013

  1. By second pass do you mean makeSureUniqueLabels() function in this commit? I extracted it purposefully to keep the main code cleaner, but sure. I guess I can keep a list of already seen labels and in case of duplicate add [2]. I'll look into this.
  2. I am not very experienced with JavaScript, so I chose Content-Disposition header on the server side. window.open() indeed seems cleaner, but I am not sure if I can handle POSTing at the same time (I send a lot of data, SVG contents, unsuitable for query parameter) Feel free to look at it, I can't promise I will manage to fix this in foreseeable future.

pstoellberger commented Jan 17, 2013

  1. yes. that would be great
  2. dont worry about that too much if you cant think of a quick/good solution. its not that bad

@nurkiewicz nurkiewicz deleted the nurkiewicz:chart-export branch Jan 17, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment