Gallery
JS Axis Line Breaks
<%@ 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 using axis line breaks at tick positions.
// Set the chart type
Chart.Type = ChartType.Combo;
Chart.JS.Enabled = true;
// Set the size
Chart.Width = 580;
Chart.Height = 350;
// Set the temp directory
Chart.TempDirectory = "temp";
// Debug mode. ( Will show generated errors if any )
Chart.Debug = false;
Chart.Title = "Axis Line Breaks";
Chart.LegendBox.Visible = false;
Chart.DefaultSeries.Type = SeriesType.Line;
// Axis Line Break settings.
Chart.XAxis.LineBreaks.Enabled = true;
Chart.XAxis.LineBreaks.Gap = .2;
Chart.XAxis.Line.Width = 4;
Chart.XAxis.Line.Color = Color.Crimson;
Chart.YAxis.LineBreaks.Enabled = true;
Chart.YAxis.Line.Width = 3;
Chart.YAxis.Line.Color = Color.Crimson;
// *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);
}
SeriesCollection getRandomData()
{
SeriesCollection SC = new SeriesCollection();
for (int a = 1; a < 2; a++)
{
Series s = new Series();
s.Name = "Series " + a;
for (int b = 2; b < 46; b++)
{
Element e = new Element();
e.XValue = b;
e.YValue = b;
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 using axis line breaks at tick positions.
' Set the chart type
Chart.Type = ChartType.Combo
Chart.JS.Enabled = True
' Set the size
Chart.Width = 580
Chart.Height = 350
' Set the temp directory
Chart.TempDirectory = "temp"
' Debug mode. ( Will show generated errors if any )
Chart.Debug = False
Chart.Title = "Axis Line Breaks"
Chart.LegendBox.Visible = False
Chart.DefaultSeries.Type = SeriesType.Line
' Axis Line Break settings.
Chart.XAxis.LineBreaks.Enabled = True
Chart.XAxis.LineBreaks.Gap =.2
Chart.XAxis.Line.Width = 4
Chart.XAxis.Line.Color = Color.Crimson
Chart.YAxis.LineBreaks.Enabled = True
Chart.YAxis.Line.Width = 3
Chart.YAxis.Line.Color = Color.Crimson
' *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)
End Sub
Function getRandomData() As SeriesCollection
Dim SC As SeriesCollection = New SeriesCollection()
For a As Integer = 1 To 1
Dim s As Series = New Series()
s.Name = "Series " & a
For b As Integer = 2 To 45
Dim e As Element = New Element()
e.XValue = b
e.YValue = b
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 FilenameJsAxisLineBreaks.aspx
- Version9.0
- Uses DatabaseNo