Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
BIRT RAP Application Bar Chart
fmakwsi
<p>Hey guys,</p><p> </p><p>i've got the problem that my Report will be shown on mobile devices aswell, thats why i want to create a bar chart via java code and not like converting the report into html code. </p><p> </p><p>Didnt find a solution or tutorial at all. Maybe you guys can help me :-) </p><p> </p><p> </p><p>Btw where can i find the option where the chart image is been cached, can find it aswell.</p><p> </p><p>Greetz</p><p> </p><p>Florian</p>
Find more posts tagged with
Comments
kclark
<p>Take a look at <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/devshare/_/designing-birt-reports/463-birt-chart-engine-api-webinar-examples'>this
devshare</a>, it has some examples showing how to use the Chart Engine API. If you're wanting to change the location of the images you would do something like this:</p><pre class="_prettyXprint _lang-">HTMLRenderOption options = new HTMLRenderOption();options.setImageDirectory(location);</pre>
fmakwsi
<p>ye found it some hours ago, but thanks anyway. is there the posiblity to avoid that the images get cached? maybe by describing them in the html file pixel by pixel??</p>
fmakwsi
<p>The solution you posted, wont work for me, because i couldnt use SWT in my runtime, is there the possiblity to cache the picture without generating an image? if i generate the report as html string?</p>
kclark
<p>If you change the location of the charts to some folder apache can get to then you can render the reports, then BIRT will save these charts to that folder, then you can write a simple class to pull the most up-to-date chart from that folder, and display it on the mobile device.</p>
fmakwsi
<p>Did it on an other way
</p><pre class="_prettyXprint _lang-js"> renderOptions.setImageHandler(new HTMLServerImageHandler() {
@Override
protected String handleImage(final IImage image, final Object context, final String prefix, final boolean needMap) { byte[] embeddedImage = image.getImageData(); char[] fileAsBytes = B64Code.encode(embeddedImage); String image = new String(fileAsBytes); return "data:image/png;base64," + image ; } });</pre>
kclark
<p>Thanks for the update, that'd make a good devshare if you wanted to share your solution!</p>