Click here to Skip to main content
15,893,401 members
Articles / Multimedia / GDI+

A flexible charting library for .NET

Rate me:
Please Sign up or sign in to vote.
4.70/5 (1,112 votes)
6 Jun 200730 min read 9.1M   180.2K   2.1K  
Looking for a way to draw 2D line graphs with C#? Here's yet another charting class library with a high degree of configurability, that is also easy to use.
<%@ Page Language="c#" codebehind="Default.aspx.cs" autoeventwireup="false" Inherits="ZG1._Default" %>
<%@ Register TagPrefix="zgw" Namespace="ZedGraph" Assembly="ZedGraph" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
    <title>Default</title>
</head>
<body>
		Demo graph, using Raw mode.<br>
		In raw mode the image is generated and sent to the browser on the fly (right click the image, select properties and look at the URL).<br><br>
        <img src="graph.aspx?graph=1" />
        <br /><br>

        Default render mode is now ImageTag.<br>
        In this mode an IMG tag is generated in-place, and the image is generated and saved in the specified folder (RenderedImagePath property, default to ~/ZedGraphImages/). Combined with the CacheDuration property it becomes powerful.<br>
        Note: the path must already exist, be under the website root and be writable.<br>
        <br>
        <ZGW:ZEDGRAPHWEB id="ZedGraphWeb1" runat="server" width="500" Height="375"></ZGW:ZEDGRAPHWEB>
        <br>
    <zgw:ZedGraphWeb ID="ZedGraphWeb2" runat="server">
    </zgw:ZedGraphWeb>
    <br>

		Other demo graphs using Raw mode.<br>
		<br>
        <img src="graph.aspx?graph=2" />
        <br />
        <img src="graph2.aspx" />
        <br />
        <img src="graph3.aspx" />
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Engineer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions