Gallery
JS AMarkers Gauges
<%@ 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)
{
// This sample demonstrates multiple gauges with axis markers.
// Set the directory where the related JSC files will be created and stored.
Chart.TempDirectory="temp";
// Specify chart type.
Chart.Type = ChartType.Gauges;
// Set he chart size.
Chart.Width = 600;
Chart.Height = 350;
Chart.DefaultAxis.Maximum = 50;
Chart.DefaultAxis.SweepAngle = 90;
Chart.YAxis.Markers.Add(new AxisMarker("", new Background(Color.Red), 40, 50));
// Set the title.
//Chart.Title="My Chart";
Chart.Debug = true;
// Enable JSCharting
Chart.JS.Enabled = true;
SeriesCollection sc = getRandomData();
sc[0].YAxis = new Axis();
// Specify the axis orientation
sc[0].YAxis.OrientationAngle = -90;
//Add an axis marker to the second gauge.
sc[0].YAxis.Markers.Add(new AxisMarker("", new Background(Color.Red), 40, 50));
// Add the random data.
Chart.SeriesCollection.Add(sc);
}
SeriesCollection getRandomData()
{
SeriesCollection SC = new SeriesCollection();
Random myR = new Random();
for(int a = 1; a < 3; a++)
{
Series s = new Series();
s.Name = "Series " + a;
for(int b = 1; b < 2; b++)
{
Element e = new Element();
e.Name = "E " + (b+1);
e.YValue = 10+myR.Next(40);
s.Elements.Add(e);
}
SC.Add(s);
}
return SC;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Gallery Sample</title></head>
<body>
<div 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)
' This sample demonstrates multiple gauges with axis markers.
' Set the directory where the related JSC files will be created and stored.
Chart.TempDirectory="temp"
' Specify chart type.
Chart.Type = ChartType.Gauges
' Set he chart size.
Chart.Width = 600
Chart.Height = 350
Chart.DefaultAxis.Maximum = 50
Chart.DefaultAxis.SweepAngle = 90
Chart.YAxis.Markers.Add(New AxisMarker("", New Background(Color.Red), 40, 50))
' Set the title.
'Chart.Title="My Chart";
Chart.Debug = True
' Enable JSCharting
Chart.JS.Enabled = True
Dim sc As SeriesCollection = getRandomData()
sc(0).YAxis = New Axis()
' Specify the axis orientation
sc(0).YAxis.OrientationAngle = -90
'Add an axis marker to the second gauge.
sc(0).YAxis.Markers.Add(New AxisMarker("", New Background(Color.Red), 40, 50))
' Add the random data.
Chart.SeriesCollection.Add(sc)
End Sub
Function getRandomData() As SeriesCollection
Dim SC As SeriesCollection = New SeriesCollection()
Dim myR As Random = New Random()
For a As Integer = 1 To 2
Dim s As Series = New Series()
s.Name = "Series " & a
For b As Integer = 1 To 1
Dim e As Element = New Element()
e.Name = "E " & (b+1)
e.YValue = 10+myR.Next(40)
s.Elements.Add(e)
Next b
SC.Add(s)
Next a
Return SC
End Function
</script>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Gallery Sample</title></head>
<body>
<div align="center">
<dotnet:Chart id="Chart" runat="server"/>
</div>
</body>
</html>
- Sample FilenameGallery/qg2.aspx
- Version8.1
- Uses DatabaseNo