ChartDirector 7.1 (.NET Edition)

Creating Charts as Image Files


In many applications, it may be useful to output charts as image files. For example, if the charts are updated only slowly (eg. daily weather charts), it may be more efficient to store the chart image on disk. Other examples include creating charts for embedding in other reports, or to be sent out by email. For these type of usage, BaseChart.makeChart can be used to output the chart an image file.

[VB]c.makeChart("c:/mychart.png")
[C#]c.makeChart("c:/mychart.png");

Note that BaseChart.makeChart expects a file system path. For a web application, if the path is a URL path, please use "Server.MapPath" to convert it to a file system path. (For a URL path, the leading "/" refers to the root of the web document directory, and the web server may apply virtual directory mapping. For a file system path, the leading "/" refers to the root of the hard disk.)

In many systems, the web server runs under a limited privilege account representing the anonymous user, and may not have write access to most of the directories. You may need to modify the security settings to grant the web server account sufficient rights to save a file to the target directory. If you are not sure which account the web server is using, you may consider to grant these rights to the "Everyone" group for testing purpose.