Building ASP.NET Web Pages with Microsoft WebMatrix by Steve Lydford

Building ASP.NET Web Pages with Microsoft WebMatrix by Steve Lydford

Author:Steve Lydford
Language: eng
Format: mobi, epub, pdf
ISBN: 9781430240204
Publisher: Apress
Published: 2011-12-13T05:00:00+00:00


<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="utf-8" />

<title>Saved Chart Example</title>

</head>

<body>

<img src="@chartFileName" />

</body>

</html>

In the code block at the top of the page we check to see if the chart already exists in the specified place on the web server. If the file does not exist, we generate some data in a generic Dictionary collection to display on the chart, then create a new chart, and add the collection as a chart series. Finally, we call the Save() method on the chart and pass in the path and filename declared on the first line to the methods path parameter.

In the body of the page, we simply use an HTML img element, pointing at the path declared in the code block, to display the chart.

The advantage of this technique is that the file is stored in the file system on the web server, rather than in a temporary cache, and so will not be lost if the web site is restarted.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.