Gallery
Background Image Stretch
<%@ Page Language="C#" Description="dotnetCHARTING Component"%>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%>
<%@ Import Namespace="System.Drawing" %>
<script runat="server">
void Page_Load(Object sender,EventArgs e)
{
//set global properties
Chart.DefaultSeries.ConnectionString = ConfigurationManager.AppSettings["DNCConnectionString"];
Chart.TitleBox.Label.Text="Orders By Customers";
Chart.TitleBox.Position = TitleBoxPosition.FullWithLegend;
Chart.XAxis.Label.Text="Customers";
Chart.TempDirectory="temp";
Chart.Debug=true;
//set backgrounds
Chart.ChartArea.Background = new Background("../../Images/background.gif",BackgroundMode.ImageStretch);
//Add a series
Chart.Series.Name="Orders";
Chart.Series.SqlStatement= @"SELECT Name,Sum(1) FROM Orders GROUP BY Name ORDER BY Sum(1) DESC";
Chart.SeriesCollection.Add();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Background Image Stretch Sample</title>
</head>
<body>
<div style="text-align:center">
<dotnet:Chart id="Chart" runat="server"/>
</div>
</body>
</html>
<%@ Page Language="vb" Description="dotnetCHARTING Component"%>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%>
<%@ Import Namespace="System.Drawing" %>
<script runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
'set global properties
Chart.DefaultSeries.ConnectionString = ConfigurationManager.AppSettings("DNCConnectionString")
Chart.TitleBox.Label.Text="Orders By Customers"
Chart.TitleBox.Position = TitleBoxPosition.FullWithLegend
Chart.XAxis.Label.Text="Customers"
Chart.TempDirectory="temp"
Chart.Debug=True
'set backgrounds
Chart.ChartArea.Background = New Background("../../Images/background.gif",BackgroundMode.ImageStretch)
'Add a series
Chart.Series.Name="Orders"
Chart.Series.SqlStatement= "SELECT Name,Sum(1) FROM Orders GROUP BY Name ORDER BY Sum(1) DESC"
Chart.SeriesCollection.Add()
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Background Image Stretch Sample</title>
</head>
<body>
<div style="text-align:center">
<dotnet:Chart id="Chart" runat="server"/>
</div>
</body>
</html>
- Sample FilenamebackgroundImageStretch.aspx
- VersionLegacy (Pre 3.0)
- Uses DatabaseYes