Gallery
JS Gauge Round
<%@ 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)
{
// Demonstrates a circular column gauge chart.
// Enable JSCharting
Chart.JS.Enabled = true;
//Set the directory where the related JSC files will be created and stored.
Chart.TempDirectory = "temp";
// Specify chart type.
Chart.Type = ChartType.Gauges;
Chart.ShadingEffectMode = ShadingEffectMode.Three;
Chart.DefaultSeries.GaugeType = GaugeType.CircularBars;
Chart.DefaultSeries.PaletteName = Palette.Default;
Chart.LegendBox.Orientation = dotnetCHARTING.Orientation.Bottom;
// Set the chart size.
Chart.Width = 600;
Chart.Height = 350;
Chart.YAxis.Minimum = 0;
Chart.YAxis.Maximum = 50;
// Set the title.
//Chart.Title = "My Chart";
Chart.Debug = false;
// Add the random data.
Chart.SeriesCollection.Add(getRandomData());
}
SeriesCollection getRandomData()
{
SeriesCollection SC = new SeriesCollection();
Random myR = new Random();
for (int a = 1; a < 2; a++)
{
Series s = new Series();
s.Name = "Series " + a;
for (int b = 1; b < 5; 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)
' Demonstrates a circular column gauge chart.
' Enable JSCharting
Chart.JS.Enabled = True
'Set the directory where the related JSC files will be created and stored.
Chart.TempDirectory = "temp"
' Specify chart type.
Chart.Type = ChartType.Gauges
Chart.ShadingEffectMode = ShadingEffectMode.Three
Chart.DefaultSeries.GaugeType = GaugeType.CircularBars
Chart.DefaultSeries.PaletteName = Palette.Default
Chart.LegendBox.Orientation = dotnetCHARTING.Orientation.Bottom
' Set the chart size.
Chart.Width = 600
Chart.Height = 350
Chart.YAxis.Minimum = 0
Chart.YAxis.Maximum = 50
' Set the title.
'Chart.Title = "My Chart";
Chart.Debug = False
' Add the random data.
Chart.SeriesCollection.Add(getRandomData())
End Sub
Function getRandomData() As SeriesCollection
Dim SC As SeriesCollection = New SeriesCollection()
Dim myR As Random = New Random()
For a As Integer = 1 To 1
Dim s As Series = New Series()
s.Name = "Series " & a
For b As Integer = 1 To 4
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 FilenameJsGaugeRound.aspx
- Version9.0
- Uses DatabaseNo