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)
{
Chart.Type = ChartType.Combo;
Chart.Width = 600;
Chart.Height = 450;
Chart.TempDirectory = "temp";
Chart.Debug = true;
Chart.Title = "Sample Data";
Chart.ChartAreaSpacing = 0;
Chart.ChartArea.HeightPercentage = 40;
SeriesCollection mySC = getRandomData();
Chart.SeriesCollection.Add(mySC);
Chart.DefaultSeries.Type = SeriesType.Spline;
Chart.ChartAreaLayout.Mode = ChartAreaLayoutMode.Vertical;
ChartArea rChartArea = new ChartArea("R Chart Example");
rChartArea.XAxis = new Axis();
rChartArea.XAxis.Interval = 1;
rChartArea.YAxis.Interval = 20;
rChartArea.TitleBox.Position = TitleBoxPosition.FullWithLegend;
Chart.ExtraChartAreas.Add(rChartArea);
Series rChart = StatisticalEngine.RChart(mySC);
rChartArea.SeriesCollection.Add(rChart);
ChartArea rXBARChartArea = new ChartArea("R XBAR Chart Example");
rXBARChartArea.XAxis = new Axis();
rXBARChartArea.XAxis.Interval = 1;
rXBARChartArea.YAxis.Interval = 10;
Chart.ExtraChartAreas.Add(rXBARChartArea);
rXBARChartArea.TitleBox.Position = TitleBoxPosition.FullWithLegend;
Series rXBARChart = StatisticalEngine.RXBARChart(mySC);
rXBARChartArea.SeriesCollection.Add(rXBARChart);
}
SeriesCollection getRandomData()
{
SeriesCollection SC = new SeriesCollection();
Random myR = new Random();
for (int a = 1; a < 11; a++)
{
Series s = new Series();
s.Name = "Series " + a;
s.LegendEntry.Visible = false;
for (int b = 1; b < 6; b++)
{
Element e = new Element();
e.Name = "Element " + b;
e.YValue = myR.Next(50);
s.Elements.Add(e);
}
SC.Add(s);
}
return SC;
}
</script>
</head>
<body>
<div style="text-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)
Chart.Type = ChartType.Combo
Chart.Width = 600
Chart.Height = 450
Chart.TempDirectory = "temp"
Chart.Debug = True
Chart.Title = "Sample Data"
Chart.ChartAreaSpacing = 0
Chart.ChartArea.HeightPercentage = 40
Dim mySC As SeriesCollection = getRandomData()
Chart.SeriesCollection.Add(mySC)
Chart.DefaultSeries.Type = SeriesType.Spline
Chart.ChartAreaLayout.Mode = ChartAreaLayoutMode.Vertical
Dim rChartArea As ChartArea = New ChartArea("R Chart Example")
rChartArea.XAxis = New Axis()
rChartArea.XAxis.Interval = 1
rChartArea.YAxis.Interval = 20
rChartArea.TitleBox.Position = TitleBoxPosition.FullWithLegend
Chart.ExtraChartAreas.Add(rChartArea)
Dim rChart As Series = StatisticalEngine.RChart(mySC)
rChartArea.SeriesCollection.Add(rChart)
Dim rXBARChartArea As ChartArea = New ChartArea("R XBAR Chart Example")
rXBARChartArea.XAxis = New Axis()
rXBARChartArea.XAxis.Interval = 1
rXBARChartArea.YAxis.Interval = 10
Chart.ExtraChartAreas.Add(rXBARChartArea)
rXBARChartArea.TitleBox.Position = TitleBoxPosition.FullWithLegend
Dim rXBARChart As Series = StatisticalEngine.RXBARChart(mySC)
rXBARChartArea.SeriesCollection.Add(rXBARChart)
End Sub
Function getRandomData() As SeriesCollection
Dim SC As SeriesCollection = New SeriesCollection()
Dim myR As Random = New Random()
For a As Integer = 1 To 10
Dim s As Series = New Series()
s.Name = "Series " & a
s.LegendEntry.Visible = False
For b As Integer = 1 To 5
Dim e As Element = New Element()
e.Name = "Element " & b
e.YValue = myR.Next(50)
s.Elements.Add(e)
Next b
SC.Add(s)
Next a
Return SC
End Function
</script>
</head>
<body>
<div style="text-align: center">
<dotnet:Chart ID="Chart" runat="server" Width="568px" Height="344px">
</dotnet:Chart>
</div>
</body>
</html>
- Sample FilenameRChart.aspx
- Version34.v
- Uses DatabaseNo