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

Message ListMessage List     Post MessagePost Message

  Pregenerated chart file
Posted by ET on Aug-19-2014 11:39
Good day Peter,

Basically I am trying to generate the chart and saved it as .PNG file (platform = .Net) and
those chart file will be loaded in web page upon request.

I wonder will I still have the features like move over/clickable after the chart is loaded
programmatically?

Please comment. Thanks.

  Re: Pregenerated chart file
Posted by Peter Kwan on Aug-20-2014 04:38
Hi ET,

For a web page, the PNG file is for the image, while the HTML image map are for the hot
spots (mouse over tooltips and clickable hot spots). ChartDirector outputs both of them.
If you would like to save both the display and the hot spots, you would need to save
both the PNG image and the HTML image map.

For example:

//save the chart image
c.makeChart("c:\\\\path\\\\to\\\\aaa.png");
string imageMap = c.getHTMLImageMap(....);
.... additional code to create a text file and save the image map to the file ....

Later, when you want to use the image and the image map, you can use something like:

<img src='... URL path to the image file ...' border='0' usemap='#xxx' />
<map id='xxx' name='xxx'>
.... read the image map from the text file and insert the image map here ...
</map>

Alternatively, you can put a WebChartViewer in the Form, and use:

myViewer.ImageUrl = .... URL path to the image file ...;
string imageMap = ... read back the image map from the text file ....;
myViewer.ImageMap = imageMap;


The above example uses files as the image and image map storage. In practice, you can
also save the chart image and the image map in other places, such as in a database.

Hope this can help.

Regards
Peter Kwan

  Re: Pregenerated chart file
Posted by ET on Aug-20-2014 11:42
Hi Peter,

Thank you so much for the advise and I managed to generate and save the image and map
as different files.

However, when I try to load back the image and map file in ASP.Net, it is not displaying.

myViewer.ImageUrl = .... URL path to the image file ...;
string imageMap = ... read back the image map from the text file ....;
myViewer.ImageMap = imageMap;

Could you create and share the example in ASP.net project? Thanks.

  Re: Pregenerated chart file
Posted by ET on Aug-20-2014 11:46
My page source after loaded the image programmatically as follow:

<input type='hidden' id='ContentPlaceHolder1_cdTrend_JsChartViewerState'
name='ContentPlaceHolder1_cdTrend_JsChartViewerState' value='' /><input type='hidden'
id='ContentPlaceHolder1_cdTrend_callBackURL'
name='ContentPlaceHolder1_cdTrend_callBackURL' value='/Default.aspx?cdLoopBack=1' />
<map id='map_ContentPlaceHolder1_cdTrend' name='map_ContentPlaceHolder1_cdTrend'>
<area shape="poly" coords="782,100,777,91,653,149,657,159" title='[Test Lot ID:
FT4190701-Q] - [Build Start Date: 2014-7-24 12:07:51] - [Yield(%): 98.58]' />
<area shape="poly" coords="414,196,536,216,657,159,653,149,534,206,416,186"
title='[Test Lot ID: FT4302200] - [Build Start Date: 2014-7-24 12:07:24] - [Yield(%):
94.50]' />
<area shape="poly" coords="174,187,295,166,416,186,414,196,295,176,176,197"
title='[Test Lot ID: FT4302100] - [Build Start Date: 2014-7-24 11:07:17] - [Yield(%):
95.96]' />
<area shape="poly" coords="49,209,51,219,176,197,174,187" title='[Test Lot ID: FT427300-
R] - [Build Start Date: 2014-7-24 11:07:27] - [Yield(%): 94.44]' />
</map><img usemap="#map_ContentPlaceHolder1_cdTrend"
id="ContentPlaceHolder1_cdTrend"
src="C:\\DataAnalysis\\Workweek\\201430\\trend\\trend_201430_ACFM-7109-SG2.png"
style="border-width:0px;" />

  Re: Pregenerated chart file
Posted by ET on Aug-20-2014 13:58
Hi Peter,

I found out the problem. Kindly disregard my previous replies. Thanks.