Gallery
<%@ Page Language="C#" Description="dotnetCHARTING Component" %>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.netCHARTING Sample</title>
<script runat="server">
void Page_Load(Object sender, EventArgs e)
{
chartObj.Type = ChartType.Combo;//Horizontal;
chartObj.Size = "600x350";
chartObj.TempDirectory = "temp";
chartObj.Debug = false;
chartObj.Mentor = false;
chartObj.DisableBrowserCache = false;
chartObj.FileName = "SvgzImage";
//chartObj.Title = ".netCHARTING Sample";
// Demonstrates using compressed svg images (svgz).
chartObj.ImageFormat = ImageFormat.Svgz;
// *DYNAMIC DATA NOTE*
// This sample uses random data to populate the chartObj. To populate
// a chart with database data see the following resources:
// - Classic samples folder
// - Help File > Data Tutorials
// - Sample: features/DataEngine.aspx
SeriesCollection mySC = getRandomData();
// Add the random data.
chartObj.SeriesCollection.Add(mySC);
}
SeriesCollection getRandomData()
{
SeriesCollection SC = new SeriesCollection();
Random myR = new Random(1);
for (int a = 1; a < 5; a++)
{
Series s = new Series();
s.Name = "Series " + a.ToString();
for (int b = 1; b < 5; b++)
{
Element e = new Element();
e.Name = "Element " + b.ToString();
e.YValue = myR.Next(50);
s.Elements.Add(e);
}
SC.Add(s);
}
return SC;
}
</script>
</head>
<body>
<div style="text-align: center">
<dotnet:Chart ID="chartObj" runat="server" Width="600px" Height="350px" />
<div style="text-align: center">
<font face="Arial" size="2">The SVGZ file has been generated when you ran this sample
and is now available in the temp directory. You can load by visiting <a href="temp/SvgzImage.svgz">this link</a> or open the file directly in any program that support SVGZ. If
you are having difficulty viewing the image, please ensure your server has the appropriate
MIME type "image/svg+xml" configured and you have set the "Content-Encoding" to
"gzip" for this entry in your web server configuration. </font>
</div>
</div>
</body>
</html>
<%@ Page Language="vb" Description="dotnetCHARTING Component" %>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.netCHARTING Sample</title>
<script runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
chartObj.Type = ChartType.Combo 'Horizontal;
chartObj.Size = "600x350"
chartObj.TempDirectory = "temp"
chartObj.Debug = False
chartObj.Mentor = False
chartObj.DisableBrowserCache = False
chartObj.FileName = "SvgzImage"
'chartObj.Title = ".netCHARTING Sample";
' Demonstrates using compressed svg images (svgz).
chartObj.ImageFormat = ImageFormat.Svgz
' *DYNAMIC DATA NOTE*
' This sample uses random data to populate the chartObj. To populate
' a chart with database data see the following resources:
' - Classic samples folder
' - Help File > Data Tutorials
' - Sample: features/DataEngine.aspx
Dim mySC As SeriesCollection = getRandomData()
' Add the random data.
chartObj.SeriesCollection.Add(mySC)
End Sub
Function getRandomData() As SeriesCollection
Dim SC As SeriesCollection = New SeriesCollection()
Dim myR As Random = New Random(1)
For a As Integer = 1 To 4
Dim s As Series = New Series()
s.Name = "Series " & a.ToString()
For b As Integer = 1 To 4
Dim e As Element = New Element()
e.Name = "Element " & b.ToString()
e.YValue = myR.Next(50)
s.Elements.Add(e)
Next b
SC.Add(s)
Next a
Return SC
End Function
</script>
</head>
<body>
<div style="text-align: center">
<dotnet:Chart ID="chartObj" runat="server" Width="600px" Height="350px" />
<div style="text-align: center">
<font face="Arial" size="2">The SVGZ file has been generated when you ran this sample
and is now available in the temp directory. You can load by visiting <a href="temp/SvgzImage.svgz">this link</a> or open the file directly in any program that support SVGZ. If
you are having difficulty viewing the image, please ensure your server has the appropriate
MIME type "image/svg+xml" configured and you have set the "Content-Encoding" to
"gzip" for this entry in your web server configuration. </font>
</div>
</div>
</body>
</html>
- Sample FilenameSvgzImage.aspx
- Version5.0
- Uses DatabaseNo