Gallery
JS Label Lists
<%@ 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)
{
// Demonstrates using lists and images to text annotations.
Chart.Type = ChartType.Combo;
Chart.Width = 340;
Chart.Height = 600;
Chart.TempDirectory = "temp";
Chart.Debug = false;
Chart.LegendBox.Visible = false;
//Clear chart
Chart.ChartArea.ClearColors();
Chart.ChartArea.Line.Width = 0;
Chart.Palette = new Color[] { };
//Enable JS
Chart.JS.Enabled = true;
Chart.JS.Buttons.EnableExportButton = false;
Chart.JS.Buttons.EnablePrintButton = false;
Chart.DefaultAxis.DefaultTick.GridLine.Width = 0;
//add annotation
Annotation an = new Annotation();
an.Line.Color = Color.LightGray;
an.Background.Color = Color.White;
an.Line.Width = 1;
an.Label.AutoWrap = false;
an.Label.Text = "<span style=\"font-size: 22px; fill: midnightblue; font-weight: bold;\">" +
"<img src=\"https://cdn.countryflags.com/thumbs/united-states-of-america/flag-round-250.png\" height=30 width=30> Federal Holidays 2020</span>" +
"<hr><ul><span style=\"font-size: 18px; fill: crimson; font-weight: bold;\">" +
"<li>January<span style=\"font-size: 14px; fill: indigo; font-weight: normal; listStyleType: none; listPadding: 16;\">" +
"<ul><li><b>1/1/2020</b> New Year's Day</li><li><b>1/20/2020</b> Martin Luther King Day</li></ul></span>" +
"</li><li>February<span style=\"font-size: 14px; fill: indigo; font-weight: normal; listStyleType: none; listPadding: 16;\">" +
"<ul><li><b>2/17/2020</b> President's Day</li></ul></span>" +
"</li><li>May<span style=\"font-size: 14px; fill: indigo; font-weight: normal; listStyleType: none; listPadding: 16;\">" +
"<ul><li><b>5/25/2020</b> Memorial Day</li></ul></span></li><li>July" +
"<span style=\"font-size: 14px; fill: indigo; font-weight: normal; listStyleType: none; listPadding: 16;\">" +
"<ul><li><b>7/3/2020</b> Independence Day (observed)</li><li><b>7/4/2020</b> Independence Day</li></ul></span></li><li>September" +
"<span style=\"font-size: 14px; fill: indigo; font-weight: normal; listStyleType: none; listPadding: 16;\">" +
"<ul><li><b>9/7/2020</b> Labor Day</li></ul></span></li><li>October" +
"<span style=\"font-size: 14px; fill: indigo; font-weight: normal; listStyleType: none; listPadding: 16;\">" +
"<ul><li><b>10/12/2020</b> Columbus Day</li></ul></span></li><li>November" +
"<span style=\"font-size: 14px; fill: indigo; font-weight: normal; listStyleType: none; listPadding: 16;\">" +
"<ul><li><b>11/11/2020</b> Veterans Day</li>" +
"<li><b>11/26/2020</b> Thanksgiving Day</li></ul></span></li><li>December" +
"<span style=\"font-size: 14px; fill: indigo; font-weight: normal; listStyleType: none; listPadding: 16;\">" +
"<ul><li><b>12/25/2020</b> Christmas Day</li></ul></span></li></ul></span>";
Chart.Annotations.Add(an);
Chart.JS.Settings.Add("annotations.0.position", "CA:center");
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.netCHARTING 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)
' Demonstrates using lists and images to text annotations.
Chart.Type = ChartType.Combo
Chart.Width = 340
Chart.Height = 600
Chart.TempDirectory = "temp"
Chart.Debug = False
Chart.LegendBox.Visible = False
'Clear chart
Chart.ChartArea.ClearColors()
Chart.ChartArea.Line.Width = 0
Chart.Palette = New Color() { }
'Enable JS
Chart.JS.Enabled = True
Chart.JS.Buttons.EnableExportButton = False
Chart.JS.Buttons.EnablePrintButton = False
Chart.DefaultAxis.DefaultTick.GridLine.Width = 0
'add annotation
Dim an As Annotation = New Annotation()
an.Line.Color = Color.LightGray
an.Background.Color = Color.White
an.Line.Width = 1
an.Label.AutoWrap = False
an.Label.Text = "<span style=""font-size: 22px; fill: midnightblue; font-weight: bold;"">" & "<img src=""https://cdn.countryflags.com/thumbs/united-states-of-america/flag-round-250.png"" height=30 width=30> Federal Holidays 2020</span>" & "<hr><ul><span style=""font-size: 18px; fill: crimson; font-weight: bold;"">" & "<li>January<span style=""font-size: 14px; fill: indigo; font-weight: normal; listStyleType: none; listPadding: 16;"">" & "<ul><li><b>1/1/2020</b> New Year's Day</li><li><b>1/20/2020</b> Martin Luther King Day</li></ul></span>" & "</li><li>February<span style=""font-size: 14px; fill: indigo; font-weight: normal; listStyleType: none; listPadding: 16;"">" & "<ul><li><b>2/17/2020</b> President's Day</li></ul></span>" & "</li><li>May<span style=""font-size: 14px; fill: indigo; font-weight: normal; listStyleType: none; listPadding: 16;"">" & "<ul><li><b>5/25/2020</b> Memorial Day</li></ul></span></li><li>July" & "<span style=""font-size: 14px; fill: indigo; font-weight: normal; listStyleType: none; listPadding: 16;"">" & "<ul><li><b>7/3/2020</b> Independence Day (observed)</li><li><b>7/4/2020</b> Independence Day</li></ul></span></li><li>September" & "<span style=""font-size: 14px; fill: indigo; font-weight: normal; listStyleType: none; listPadding: 16;"">" & "<ul><li><b>9/7/2020</b> Labor Day</li></ul></span></li><li>October" & "<span style=""font-size: 14px; fill: indigo; font-weight: normal; listStyleType: none; listPadding: 16;"">" & "<ul><li><b>10/12/2020</b> Columbus Day</li></ul></span></li><li>November" & "<span style=""font-size: 14px; fill: indigo; font-weight: normal; listStyleType: none; listPadding: 16;"">" & "<ul><li><b>11/11/2020</b> Veterans Day</li>" & "<li><b>11/26/2020</b> Thanksgiving Day</li></ul></span></li><li>December" & "<span style=""font-size: 14px; fill: indigo; font-weight: normal; listStyleType: none; listPadding: 16;"">" & "<ul><li><b>12/25/2020</b> Christmas Day</li></ul></span></li></ul></span>"
Chart.Annotations.Add(an)
Chart.JS.Settings.Add("annotations.0.position", "CA:center")
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.netCHARTING Sample</title>
</head>
<body>
<div align="center">
<dotnet:Chart ID="Chart" runat="server" />
</div>
</body>
</html>
- Sample FilenameJsLabelLists.aspx
- Version9.1
- Uses DatabaseNo