Gallery
JS Aqua Range Columns
<%@ 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 range bars with ShadingEffectMode.Two.
// Specify chart type.
Chart.Type = ChartType.Combo;
Chart.ShadingEffectMode = ShadingEffectMode.Two;
// Set he chart size.
Chart.Width = 600;
Chart.Height = 350;
// Set the title.
Chart.Title = "Test score ranges per student. [Best: %maxValueElementName %high%, Worst: %minValueElementName %low%]";
Chart.Debug = true;
Chart.DefaultElement.ToolTip = "<b>%name</b> <br/>Score range: <b>%yStart%</b> - <b>%yValue%</b><br/>Percentile: <b>%yPercentile%</b>";
//Chart.PieLabelMode = PieLabelMode.Inside;
Chart.LegendBox.Visible = false;
Chart.YAxis.Maximum = 100;
//Put a percent sign after value on y axis.
Chart.YAxis.DefaultTick.Label.Text = "%value%";
Chart.YAxis.Markers.Add(new AxisMarker("Failing", new Background(Color.FromArgb(80, Color.Red)), 0, 60));
// Set the directory where the related JSC files will be created and stored.
Chart.TempDirectory="temp";
// Enable JSCharting
Chart.JS.Enabled = true;
// Add the random data.
Chart.SeriesCollection.Add(getRandomData());
}
SeriesCollection getRandomData()
{
string[] names = new string[] { "Brayden", "Aiden", "Mason", "Anthony", "Elijah", "Mateo", "Levi", "Luke", "Connor", "Cameron"};
double[] lowScores = new double[] { 57.5,32.5,55,58.5,61,46,51.5,41,52.5,51.5};
double[] highScores = new double[] { 96,72,83,78,87,73,81,63,76,69};
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 < 11; b++)
{
Element e = new Element();
e.Name = names[b-1];
e.YValue = highScores[b-1];
e.YValueStart = lowScores[b-1];
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 range bars with ShadingEffectMode.Two.
' Specify chart type.
Chart.Type = ChartType.Combo
Chart.ShadingEffectMode = ShadingEffectMode.Two
' Set he chart size.
Chart.Width = 600
Chart.Height = 350
' Set the title.
Chart.Title = "Test score ranges per student. [Best: %maxValueElementName %high%, Worst: %minValueElementName %low%]"
Chart.Debug = True
Chart.DefaultElement.ToolTip = "<b>%name</b> <br/>Score range: <b>%yStart%</b> - <b>%yValue%</b><br/>Percentile: <b>%yPercentile%</b>"
'Chart.PieLabelMode = PieLabelMode.Inside;
Chart.LegendBox.Visible = False
Chart.YAxis.Maximum = 100
'Put a percent sign after value on y axis.
Chart.YAxis.DefaultTick.Label.Text = "%value%"
Chart.YAxis.Markers.Add(New AxisMarker("Failing", New Background(Color.FromArgb(80, Color.Red)), 0, 60))
' Set the directory where the related JSC files will be created and stored.
Chart.TempDirectory="temp"
' Enable JSCharting
Chart.JS.Enabled = True
' Add the random data.
Chart.SeriesCollection.Add(getRandomData())
End Sub
Function getRandomData() As SeriesCollection
Dim names As String() = New String() { "Brayden", "Aiden", "Mason", "Anthony", "Elijah", "Mateo", "Levi", "Luke", "Connor", "Cameron"}
Dim lowScores As Double() = New Double() { 57.5,32.5,55,58.5,61,46,51.5,41,52.5,51.5}
Dim highScores As Double() = New Double() { 96,72,83,78,87,73,81,63,76,69}
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 10
Dim e As Element = New Element()
e.Name = names(b-1)
e.YValue = highScores(b-1)
e.YValueStart = lowScores(b-1)
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/qc1.aspx
- Version8.1
- Uses DatabaseNo