Gallery
JS Org List Tags
<%@ Page Language="C#" Description="dotnetCHARTING Component" %>
<%@ Register TagPrefix="dnc" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING" %>
<%@ Import Namespace="System.Drawing" %>
<script runat="server">
void Page_Load(Object sender, EventArgs e)
{
// Demonstrates an organization chart with UL LI list tags.
Chart.TempDirectory = "temp";
Chart.Debug = false;
Chart.JS.Enabled = true;
Chart.Type = ChartType.Organizational;
Chart.Size = "600x450";
Chart.LegendBox.Visible = false;
Chart.DefaultElement.ToolTip = "<span style=\'listStyleType: circle; listPadding: 0;\'>%tasks</span>";
Chart.DefaultSeries.DefaultElement.Color = Color.FromArgb(179,217,255);
Chart.DefaultElement.Outline.Color = Color.FromArgb(0,64,128);
Chart.DefaultElement.Outline.Width = 1;
Chart.DefaultSeries.Line.Width = 1;
Chart.DefaultSeries.Line.Color = Color.FromArgb(0,64,128);
Chart.DefaultElement.Annotation = new Annotation("<b>%name</b><br/>%data");
Chart.DefaultElement.Annotation.Label.AutoWrap = false;
Chart.DefaultElement.Annotation.Label.Color = Color.FromArgb(0,64,128);
Chart.DefaultElement.Annotation.Padding = 9;
Chart.DefaultElement.Annotation.Size = new Size(180, 80);
Chart.DefaultElement.Annotation.CornerTopLeft = BoxCorner.Cut;
Chart.DefaultElement.Annotation.CornerTopRight = BoxCorner.Square;
Chart.DefaultElement.Annotation.CornerBottomRight = BoxCorner.Cut;
Chart.DefaultElement.Annotation.CornerBottomLeft = BoxCorner.Square;
Chart.DefaultElement.Annotation.Label.Alignment = StringAlignment.Near;
Chart.JS.Settings.Add("defaultPoint.annotation.margin", "[15,5,10,0]");
Chart.JS.Settings.Add("series.0.points.0.label.color", "White");
// *DYNAMIC DATA NOTE*
// This sample uses random data to populate the chart. To populate
// a chart with database data see the following resources:
// - Use the getLiveData() method using the dataEngine to query a database.
// - Help File > Getting Started > Data Tutorials
// - DataEngine Class in the help file
// - Sample: features/DataEngine.aspx
SeriesCollection mySC = getData();
// Add the random data.
Chart.SeriesCollection.Add(mySC);
}
SeriesCollection getData()
{
Element e1 = new Element("Margret Swanson");
e1.Color = Color.FromArgb(0, 64, 128);
Element e2 = new Element("Mark Hudson");
Element e3 = new Element("Chris Lysek");
Element e4 = new Element("Karyn Borbas");
Element e5 = new Element("Chris Rup");
e1.CustomAttributes.Add("data", "<ul><li>President</li><li>630-555-1111</li><li><i>Batavia, IL</i></li></ul>");
e2.CustomAttributes.Add("data", "<ul><li>Vice President Marketing</li><li>630-555-1111</li><li><i>Hanover Park, IL</i></li></ul>");
e3.CustomAttributes.Add("data", "<ul><li>Vice President Sales</li><li>630-555-2222</li><li><i>West Chicago, IL</i></li></ul>");
e4.CustomAttributes.Add("data", "<ul><li>Marketing Manager</li><li>312-555-3333</li><li><i>Chicago, IL</i></li></ul>");
e5.CustomAttributes.Add("data", "<ul><li>Marketing Manager</li><li>773-555-4444</li><li><i>Chicago, IL</i></li></ul>");
e1.CustomAttributes.Add("tasks", "<ul><li>Operations</li><li>Bookkeeping</li><li><i>Strategy</i></li></ul>");
e2.CustomAttributes.Add("tasks", "<ul><li>Product Strategy</li><li>Artistic Direction</li><li><i>Product Design</i></li></ul>");
e3.CustomAttributes.Add("tasks", "<ul><li>Sales HR</li><li>Market Development</li></ul>");
e4.CustomAttributes.Add("tasks", "<ul><li>Purchasing</li><li>Review</li></ul>");
e5.CustomAttributes.Add("tasks", "<ul><li>Marketing HR</li><li>Market Research</li></ul>");
e2.Parent = e1;
e3.Parent = e1;
e4.Parent = e2;
e5.Parent = e2;
return new SeriesCollection(new Series("", e1, e2, e3, e4, e5));
}
SeriesCollection getLiveData()
{
DataEngine de = new DataEngine("ConnectionString goes here");
de.ChartObject = Chart; // Necessary to view any errors the dataEngine may throw.
de.SqlStatement = "SELECT XAxisColumn, YAxisColumn FROM ....";
return de.GetSeries();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.netCHARTING Sample</title>
</head>
<body>
<dnc:Chart ID="Chart" runat="server" style="max-width:600px;max-height:500px;margin:0px auto;"/>
</body>
</html>
<%@ Page Language="vb" Description="dotnetCHARTING Component" %>
<%@ Register TagPrefix="dnc" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING" %>
<%@ Import Namespace="System.Drawing" %>
<script runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
' Demonstrates an organization chart with UL LI list tags.
Chart.TempDirectory = "temp"
Chart.Debug = False
Chart.JS.Enabled = True
Chart.Type = ChartType.Organizational
Chart.Size = "600x450"
Chart.LegendBox.Visible = False
Chart.DefaultElement.ToolTip = "<span style='listStyleType: circle; listPadding: 0;'>%tasks</span>"
Chart.DefaultSeries.DefaultElement.Color = Color.FromArgb(179,217,255)
Chart.DefaultElement.Outline.Color = Color.FromArgb(0,64,128)
Chart.DefaultElement.Outline.Width = 1
Chart.DefaultSeries.Line.Width = 1
Chart.DefaultSeries.Line.Color = Color.FromArgb(0,64,128)
Chart.DefaultElement.Annotation = New Annotation("<b>%name</b><br/>%data")
Chart.DefaultElement.Annotation.Label.AutoWrap = False
Chart.DefaultElement.Annotation.Label.Color = Color.FromArgb(0,64,128)
Chart.DefaultElement.Annotation.Padding = 9
Chart.DefaultElement.Annotation.Size = New Size(180, 80)
Chart.DefaultElement.Annotation.CornerTopLeft = BoxCorner.Cut
Chart.DefaultElement.Annotation.CornerTopRight = BoxCorner.Square
Chart.DefaultElement.Annotation.CornerBottomRight = BoxCorner.Cut
Chart.DefaultElement.Annotation.CornerBottomLeft = BoxCorner.Square
Chart.DefaultElement.Annotation.Label.Alignment = StringAlignment.Near
Chart.JS.Settings.Add("defaultPoint.annotation.margin", "[15,5,10,0]")
Chart.JS.Settings.Add("series.0.points.0.label.color", "White")
' *DYNAMIC DATA NOTE*
' This sample uses random data to populate the chart. To populate
' a chart with database data see the following resources:
' - Use the getLiveData() method using the dataEngine to query a database.
' - Help File > Getting Started > Data Tutorials
' - DataEngine Class in the help file
' - Sample: features/DataEngine.aspx
Dim mySC As SeriesCollection = getData()
' Add the random data.
Chart.SeriesCollection.Add(mySC)
End Sub
Function getData() As SeriesCollection
Dim e1 As Element = New Element("Margret Swanson")
e1.Color = Color.FromArgb(0, 64, 128)
Dim e2 As Element = New Element("Mark Hudson")
Dim e3 As Element = New Element("Chris Lysek")
Dim e4 As Element = New Element("Karyn Borbas")
Dim e5 As Element = New Element("Chris Rup")
e1.CustomAttributes.Add("data", "<ul><li>President</li><li>630-555-1111</li><li><i>Batavia, IL</i></li></ul>")
e2.CustomAttributes.Add("data", "<ul><li>Vice President Marketing</li><li>630-555-1111</li><li><i>Hanover Park, IL</i></li></ul>")
e3.CustomAttributes.Add("data", "<ul><li>Vice President Sales</li><li>630-555-2222</li><li><i>West Chicago, IL</i></li></ul>")
e4.CustomAttributes.Add("data", "<ul><li>Marketing Manager</li><li>312-555-3333</li><li><i>Chicago, IL</i></li></ul>")
e5.CustomAttributes.Add("data", "<ul><li>Marketing Manager</li><li>773-555-4444</li><li><i>Chicago, IL</i></li></ul>")
e1.CustomAttributes.Add("tasks", "<ul><li>Operations</li><li>Bookkeeping</li><li><i>Strategy</i></li></ul>")
e2.CustomAttributes.Add("tasks", "<ul><li>Product Strategy</li><li>Artistic Direction</li><li><i>Product Design</i></li></ul>")
e3.CustomAttributes.Add("tasks", "<ul><li>Sales HR</li><li>Market Development</li></ul>")
e4.CustomAttributes.Add("tasks", "<ul><li>Purchasing</li><li>Review</li></ul>")
e5.CustomAttributes.Add("tasks", "<ul><li>Marketing HR</li><li>Market Research</li></ul>")
e2.Parent = e1
e3.Parent = e1
e4.Parent = e2
e5.Parent = e2
Return New SeriesCollection(New Series("", e1, e2, e3, e4, e5))
End Function
Function getLiveData() As SeriesCollection
Dim de As DataEngine = New DataEngine("ConnectionString goes here")
de.ChartObject = Chart ' Necessary to view any errors the dataEngine may throw.
de.SqlStatement = "SELECT XAxisColumn, YAxisColumn FROM ...."
Return de.GetSeries()
End Function
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.netCHARTING Sample</title>
</head>
<body>
<dnc:Chart ID="Chart" runat="server" style="max-width:600px;max-height:500px;margin:0px auto;"/>
</body>
</html>
- Sample FilenameJsOrgListTags.aspx
- Version9.1
- Uses DatabaseNo