Gallery
<%@ Page Language="C#" Description="dotnetCHARTING Component" %>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING" %>
<%@ Import Namespace="System.Drawing" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.netCHARTING Sample</title>
<script runat="server">
void Page_Load(Object sender, EventArgs e)
{
// Demonstrates Line chart with arrow caps.
Chart.Type = ChartType.Combo;//Horizontal;
Chart.Width = 600;
Chart.Height = 350;
Chart.TempDirectory = "temp";
Chart.TitleBox.Label.Text = "Purchases Trending Up";
Chart.TitleBox.Label.Font = new Font("Tahoma", 10, FontStyle.Bold);
Chart.TitleBox.ClearColors();
Chart.Debug = false;
Chart.DefaultSeries.Type = SeriesType.Line;
Chart.DefaultSeries.DefaultElement.Marker.Visible = false;
Chart.DefaultSeries.Line.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
Chart.JS.Enabled = true;
Chart.LegendBox.Visible = false;
// *DYNAMIC DATA NOTE*
// This sample uses random data to populate the chart. 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();
Chart.XAxis.Scale = Scale.Time;
Chart.YAxis.FormatString = "c:0";
// Add the random data.
Chart.SeriesCollection.Add(mySC);
}
SeriesCollection getRandomData()
{
SeriesCollection SC = new SeriesCollection();
Series Purchases = new Series();
Purchases.Name = "Purchases";
Purchases.Elements.Add(new Element("",new DateTime(2020, 1, 1),29.2));
Purchases.Elements.Add(new Element("",new DateTime(2020, 2, 1),71.2));
Purchases.Elements.Add(new Element("",new DateTime(2020, 3, 1),106.2));
Purchases.Elements.Add(new Element("",new DateTime(2020, 4, 1),66.2));
Purchases.Elements.Add(new Element("",new DateTime(2020, 5, 1),169.2));
Purchases.Elements.Add(new Element("",new DateTime(2020, 6, 1),144.2));
Purchases.Elements.Add(new Element("",new DateTime(2020, 7, 1),226.2));
SC.Add(Purchases);
return SC;
}
</script>
</head>
<body>
<div align="center">
<dotnet:Chart ID="Chart" runat="server" Width="568px" Height="344px">
</dotnet:Chart>
</div>
</body>
</html>
<%@ Page Language="vb" Description="dotnetCHARTING Component" %>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING" %>
<%@ Import Namespace="System.Drawing" %>
<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)
' Demonstrates Line chart with arrow caps.
Chart.Type = ChartType.Combo 'Horizontal;
Chart.Width = 600
Chart.Height = 350
Chart.TempDirectory = "temp"
Chart.TitleBox.Label.Text = "Purchases Trending Up"
Chart.TitleBox.Label.Font = New Font("Tahoma", 10, FontStyle.Bold)
Chart.TitleBox.ClearColors()
Chart.Debug = False
Chart.DefaultSeries.Type = SeriesType.Line
Chart.DefaultSeries.DefaultElement.Marker.Visible = False
Chart.DefaultSeries.Line.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor
Chart.JS.Enabled = True
Chart.LegendBox.Visible = False
' *DYNAMIC DATA NOTE*
' This sample uses random data to populate the chart. 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()
Chart.XAxis.Scale = Scale.Time
Chart.YAxis.FormatString = "c:0"
' Add the random data.
Chart.SeriesCollection.Add(mySC)
End Sub
Function getRandomData() As SeriesCollection
Dim SC As SeriesCollection = New SeriesCollection()
Dim Purchases As Series = New Series()
Purchases.Name = "Purchases"
Purchases.Elements.Add(New Element("",New DateTime(2020, 1, 1),29.2))
Purchases.Elements.Add(New Element("",New DateTime(2020, 2, 1),71.2))
Purchases.Elements.Add(New Element("",New DateTime(2020, 3, 1),106.2))
Purchases.Elements.Add(New Element("",New DateTime(2020, 4, 1),66.2))
Purchases.Elements.Add(New Element("",New DateTime(2020, 5, 1),169.2))
Purchases.Elements.Add(New Element("",New DateTime(2020, 6, 1),144.2))
Purchases.Elements.Add(New Element("",New DateTime(2020, 7, 1),226.2))
SC.Add(Purchases)
Return SC
End Function
</script>
</head>
<body>
<div align="center">
<dotnet:Chart ID="Chart" runat="server" Width="568px" Height="344px">
</dotnet:Chart>
</div>
</body>
</html>
- Sample FilenameJsLineTypeCaps.aspx
- Version9.3
- Uses DatabaseNo