Gallery
JS Box Corners
<%@ Page Language="C#" Description="dotnetCHARTING Component" %>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.netCHARTING Sample</title>
<script runat="server">
void Page_Load(Object sender, EventArgs e)
{
// Demonstrates Applying box corner styling to different chart elements.
// Set the chart type
Chart.Type = ChartType.Combo;
//Enable JSCharting
Chart.JS.Enabled = true;
// Set the size
Chart.Width = 680;
Chart.Height = 350;
// Set the temp directory
Chart.TempDirectory = "temp";
// Debug mode. ( Will show generated errors if any )
Chart.Debug = false;
Chart.DefaultBox.Background.ShadingEffectMode = ShadingEffectMode.None;
Chart.DefaultBox.Shadow.Visible = false;
Chart.TitleBox.Label.Text = "Chart Box Corner Styles";
Chart.TitleBox.DefaultCorner =BoxCorner.Square;
Chart.TitleBox.CornerTopRight = BoxCorner.Round;
Chart.DefaultSeries.Type = SeriesType.Line;
Chart.LegendBox.DefaultCorner = BoxCorner.Square;
Chart.LegendBox.CornerTopRight = BoxCorner.Round;
Chart.LegendBox.CornerTopLeft = BoxCorner.Round;
Chart.TitleBox.Background.Color =Color.LightBlue;
Chart.LegendBox.Background.Color = Color.LightBlue;
Annotation an = new Annotation("Arbitrary Annotation 1");
an.CornerBottomLeft = BoxCorner.Cut;
an.CornerTopRight = BoxCorner.Round;
an.CornerSize = 20;
an.Position = new Point(70, 40);
an.Background.Color =Color.LightBlue;// Color.FromArgb(230, 230, 230);
Chart.Annotations.Add(an);
// *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();
// Add the random data.
Chart.SeriesCollection.Add(mySC);
//FullScreen
}
SeriesCollection getRandomData()
{
SeriesCollection SC = new SeriesCollection();
Random myR = new Random(5);
string[] str = { "A", "B", "C", "D", "E", "F", "G", "H" };
for (int a = 1; a < 2; a++)
{
Series s = new Series();
s.Name = "Series " + a;
for (int b = 1; b < 9; b++)
{
Element e = new Element();
e.Name = str[b - 1];
e.YValue = 20 + myR.Next(50) + (a * 80);
s.Elements.Add(e);
}
SC.Add(s);
}
return SC;
}
</script>
</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" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<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 Applying box corner styling to different chart elements.
' Set the chart type
Chart.Type = ChartType.Combo
'Enable JSCharting
Chart.JS.Enabled = True
' Set the size
Chart.Width = 680
Chart.Height = 350
' Set the temp directory
Chart.TempDirectory = "temp"
' Debug mode. ( Will show generated errors if any )
Chart.Debug = False
Chart.DefaultBox.Background.ShadingEffectMode = ShadingEffectMode.None
Chart.DefaultBox.Shadow.Visible = False
Chart.TitleBox.Label.Text = "Chart Box Corner Styles"
Chart.TitleBox.DefaultCorner =BoxCorner.Square
Chart.TitleBox.CornerTopRight = BoxCorner.Round
Chart.DefaultSeries.Type = SeriesType.Line
Chart.LegendBox.DefaultCorner = BoxCorner.Square
Chart.LegendBox.CornerTopRight = BoxCorner.Round
Chart.LegendBox.CornerTopLeft = BoxCorner.Round
Chart.TitleBox.Background.Color =Color.LightBlue
Chart.LegendBox.Background.Color = Color.LightBlue
Dim an As Annotation = New Annotation("Arbitrary Annotation 1")
an.CornerBottomLeft = BoxCorner.Cut
an.CornerTopRight = BoxCorner.Round
an.CornerSize = 20
an.Position = New Point(70, 40)
an.Background.Color =Color.LightBlue ' Color.FromArgb(230, 230, 230);
Chart.Annotations.Add(an)
' *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()
' Add the random data.
Chart.SeriesCollection.Add(mySC)
'FullScreen
End Sub
Function getRandomData() As SeriesCollection
Dim SC As SeriesCollection = New SeriesCollection()
Dim myR As Random = New Random(5)
Dim str As String() = { "A", "B", "C", "D", "E", "F", "G", "H" }
For a As Integer = 1 To 1
Dim s As Series = New Series()
s.Name = "Series " & a
For b As Integer = 1 To 8
Dim e As Element = New Element()
e.Name = str(b - 1)
e.YValue = 20 + myR.Next(50) + (a * 80)
s.Elements.Add(e)
Next b
SC.Add(s)
Next a
Return SC
End Function
</script>
</head>
<body>
<div align="center">
<dotnet:Chart ID="Chart" runat="server" />
</div>
</body>
</html>
- Sample FilenameJsBoxCorners.aspx
- Version9.0
- Uses DatabaseNo