ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Save Chart Image when clickon on A HREF
Posted by Adrian on Jul-05-2014 21:25
Hi,

is there a way for ChartDirector to return an image from the java web session when a user clicks on a link & then display a popup save image window?

The code below shows what I currently have. Currently, when user clicks on link it simply goes to another webpage with the chart image. But I want a popup window to appear so the user can save their chart.

Any guidance would be appreciated.
Thanks

HTML CODE
<a href="/MyJavaWebApp/ReturnImageOfChart" > Popup Save Window Here</a>

JAVA SERVLET CODE
WebChartViewer.streamChart(response, xyChart.makeChart2(Chart.PNG));

  Re: Save Chart Image when clickon on A HREF
Posted by Peter Kwan on Jul-07-2014 20:05
Hi Adrian,

According to the HTTP standard, the "Content-Disposition" attribute can be used. May be
you can try something like:

response.setHeader("Content-Disposition", "attachment");
WebChartViewer.streamChart(response, xyChart.makeChart2(Chart.PNG));

Regards
Peter Kwan

  Re: Save Chart Image when clickon on A HREF
Posted by Adrian on Jul-08-2014 08:35
That worked. Thank you.

One last question. I read somewhere that version 6 of CD will be released in October. Is there a link detailing what changes will be included? Or at least tell us of some changes that will be in the release.

Thanks

  Re: Save Chart Image when clickon on A HREF
Posted by Peter Kwan on Jul-09-2014 03:00
Hi Andrian,

The main features in ChartDirector Ver 6 are:

- Enhanced interaction support. For example, the programmable track cursors and drag to
zoom/scroll will support touch based user interface. There will be a "range control", which is
like a "scroll bar", but with the background of the scroll bar being a chart showing all the
data, and the handle of the scroll bar being a draggable and resizable window. The "range
control" can be used to select the range to be displayed on the main chart.

- Direct PDF output support

- Facelift for gauges and meters

- Many other graphics improvements, such as bar chart and box chart with rounded bars /
boxes, candlestick charts with hollow/filled style support, symbol offset support,
coutour/surface color specification in terms of data values, etc......

Regards
Peter Kwan