Jump to content
Software FX Community

Streaming images resizing problem


User (Legacy)

Recommended Posts

Hello,

We are using the Java Community Edition of Chart FX and we are encountering a problem. When we try to include a chart on our jsp, it ignores our attempts to size the chart. It seems to always put out an image that is approximately 300px by 300px.

This is the line of code that is in the jsp:

<img src='context/process/barchartstream.do' />

And this is the code we use to set the size in barchartstream.java. We have breakpointed the java file, and we know it is being hit:

response.setContentType("image/x-png");

ServletOutputStream outStream = response.getOutputStream();

_chart.getHtmlDataEx(new Integer(700),

new Integer(425), "png",

outStream, outStream, outStream)

The funny thing is, the chart use to be sized correctly when we created a static image on our servers instead of streaming it. This is the code we used to use on our jsp, and it DID size the chart correctly (unfortunately, we must have streaming):

<% ChartServer chart1 = (ChartServer) request.getAttribute("chart"); %>

<%=chart1.getHtmlTag("700","425","PNG")%>

We use an XML file to initialize charts, but that file does not set any size attributes.

Does anyone know why our streaming image is not sized correctly?

Thanks,

Brendan

Link to comment
Share on other sites

Hi Brian, 

It seems there is a bug when you pass the width and height as Integer. If you pass them as string it produces the chart with the desired size. I'll log the bug for correction.

Anyway, the way you are calling the getHtmlData, may cause you some issues. Unless you want to generate Image Maps for tool tips display, you should use getHtmlData instead. The only difference is that getHtmlData will directly output to the OutputStream.

GA

Software FX, Inc.

"Brendan O'Brien" <brendan.obrien@appiancorp.com> wrote in message news:6L6UpRHsEHA.2576@webserver3.softwarefx.com...

Hello,

We are using the Java Community Edition of Chart FX and we are encountering a problem. When we try to include a chart on our jsp, it ignores our attempts to size the chart. It seems to always put out an image that is approximately 300px by 300px.

This is the line of code that is in the jsp:

<img src='context/process/barchartstream.do' />

And this is the code we use to set the size in barchartstream.java. We have breakpointed the java file, and we know it is being hit:

response.setContentType("image/x-png");

ServletOutputStream outStream = response.getOutputStream();

_chart.getHtmlDataEx(new Integer(700),

new Integer(425), "png",

outStream, outStream, outStream)

The funny thing is, the chart use to be sized correctly when we created a static image on our servers instead of streaming it. This is the code we used to use on our jsp, and it DID size the chart correctly (unfortunately, we must have streaming):

<% ChartServer chart1 = (ChartServer) request.getAttribute("chart"); %>

<%=chart1.getHtmlTag("700","425","PNG")%>

We use an XML file to initialize charts, but that file does not set any size attributes.

Does anyone know why our streaming image is not sized correctly?

Thanks,

Brendan

Link to comment
Share on other sites

A related question:

If I pass a percentage as the width or height of a chart image (using getHtmlData) I get a NumberFormatException. This should be supported, correct?

Thanks,

Brendan

"SoftwareFX Support" <support@softwarefx.com> wrote in message news:rs7UR9IsEHA.3136@webserver3.softwarefx.com...

Hi Brian,

It seems there is a bug when you pass the width and height as Integer. If you pass them as string it produces the chart with the desired size. I'll log the bug for correction.

Anyway, the way you are calling the getHtmlData, may cause you some issues. Unless you want to generate Image Maps for tool tips display, you should use getHtmlData instead. The only difference is that getHtmlData will directly output to the OutputStream.

GA

Software FX, Inc.

"Brendan O'Brien" <brendan.obrien@appiancorp.com> wrote in message news:6L6UpRHsEHA.2576@webserver3.softwarefx.com...

Hello,

We are using the Java Community Edition of Chart FX and we are encountering a problem. When we try to include a chart on our jsp, it ignores our attempts to size the chart. It seems to always put out an image that is approximately 300px by 300px.

This is the line of code that is in the jsp:

<img src='context/process/barchartstream.do' />

And this is the code we use to set the size in barchartstream.java. We have breakpointed the java file, and we know it is being hit:

response.setContentType("image/x-png");

ServletOutputStream outStream = response.getOutputStream();

_chart.getHtmlDataEx(new Integer(700),

new Integer(425), "png",

outStream, outStream, outStream)

The funny thing is, the chart use to be sized correctly when we created a static image on our servers instead of streaming it. This is the code we used to use on our jsp, and it DID size the chart correctly (unfortunately, we must have streaming):

<% ChartServer chart1 = (ChartServer) request.getAttribute("chart"); %>

<%=chart1.getHtmlTag("700","425","PNG")%>

We use an XML file to initialize charts, but that file does not set any size attributes.

Does anyone know why our streaming image is not sized correctly?

Thanks,

Brendan

Link to comment
Share on other sites

No, we do not support percentages, you have to pass a fixed width and height.

GA

SoftwareFX

"Brendan O'Brien" <brendan.obrien@appiancorp.com> wrote in message news:OSb52mhsEHA.3240@webserver3.softwarefx.com...

A related question:

If I pass a percentage as the width or height of a chart image (using getHtmlData) I get a NumberFormatException. This should be supported, correct?

Thanks,

Brendan

"SoftwareFX Support" <support@softwarefx.com> wrote in message news:rs7UR9IsEHA.3136@webserver3.softwarefx.com...

Hi Brian,

It seems there is a bug when you pass the width and height as Integer. If you pass them as string it produces the chart with the desired size. I'll log the bug for correction.

Anyway, the way you are calling the getHtmlData, may cause you some issues. Unless you want to generate Image Maps for tool tips display, you should use getHtmlData instead. The only difference is that getHtmlData will directly output to the OutputStream.

GA

Software FX, Inc.

"Brendan O'Brien" <brendan.obrien@appiancorp.com> wrote in message news:6L6UpRHsEHA.2576@webserver3.softwarefx.com...

Hello,

We are using the Java Community Edition of Chart FX and we are encountering a problem. When we try to include a chart on our jsp, it ignores our attempts to size the chart. It seems to always put out an image that is approximately 300px by 300px.

This is the line of code that is in the jsp:

<img src='context/process/barchartstream.do' />

And this is the code we use to set the size in barchartstream.java. We have breakpointed the java file, and we know it is being hit:

response.setContentType("image/x-png");

ServletOutputStream outStream = response.getOutputStream();

_chart.getHtmlDataEx(new Integer(700),

new Integer(425), "png",

outStream, outStream, outStream)

The funny thing is, the chart use to be sized correctly when we created a static image on our servers instead of streaming it. This is the code we used to use on our jsp, and it DID size the chart correctly (unfortunately, we must have streaming):

<% ChartServer chart1 = (ChartServer) request.getAttribute("chart"); %>

<%=chart1.getHtmlTag("700","425","PNG")%>

We use an XML file to initialize charts, but that file does not set any size attributes.

Does anyone know why our streaming image is not sized correctly?

Thanks,

Brendan

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...