Bug 334063 - Report & Chart custom size in pixel are converted into pt
Summary: Report & Chart custom size in pixel are converted into pt
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Birt-ReportEngine-inbox@eclipse.org CLA
QA Contact: Xiaoying Gu CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-12 05:15 EST by Julien Muller CLA
Modified: 2011-02-17 02:51 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Muller CLA 2011-01-12 05:15:53 EST
Build Identifier: M20100909-0800

When rendering in html, it is important to have control over the size of the components integrated. In the html context, pixel is more used than pt.

If you create a report with a Custom master size defined in pixel, chart size defined in pixels, and present it as html in an app, I realized the chart images are weirdly resized. This makes a really bad definition and quality is hardly acceptable.

While trying to understand the problem, I realized the sizes defined in px in the .rptdesign file:
<property name="height">200px</property>
<property name="width">300px</property>
Are rendered in pt in the html output:
style=" width: 303pt; height: 202pt;"
>> Since these units are very different, the result is not what I expected. I assume birt mix up px and pt.

The expected behavior (IMO) would be to have a size definition that match the rendering: If a chart is create with custom size 200px,300px, I expect the chart to be rendered at an acceptable definition (dpi) on a screen.

Workaround: This can be adjusted using dpi, since there is a correlation between px, pt and dpi:
HTMLRenderOption options = new HTMLRenderOption();
options.setOption(HTMLRenderOption.CHART_DPI,300);

Reproducible: Always

Steps to Reproduce:
1.Create a new report
2.define a master custom size in px
3.Create a chart
4.Define a chart custom size in px, set the type as jpg (the result is more obvious)
5.Render in html(for instance in the birt viewer)
6.Checking the html source, you will notice your sizes are converted into pt and designer has no way to ajust this.
Comment 1 Julien Muller CLA 2011-01-13 13:40:17 EST
The problem is in fact specific to chart size. Further testing demonstrated:
- jpg: in the chart properties, size was 300px / 200px
  result:
        <img style="width: 300pt; height: 200pt;" alt="" src="charts/chart14a523412d809572c71.jpg" id="__bookmark_1" class="style_1">
- svg: In the chart properties, size: 700px / 500px
  result:
        <embed style="width: 700pt; height: 500pt;" alt="" src="charts/chartcf0bfc12d809745b51.svg" type="image/svg+xml" onresize="document.getElementById('__bookmark_1').reload()" id="__bookmark_1">