Gallery
JS Pie Csv
<%@ Page Language="C#" Description="dotnetCHARTING Component" %>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<%@ Import Namespace="System.Collections.Generic" %>
<script runat="server">
void Page_Load(Object sender, EventArgs e)
{
// Demonstrates a styling variation of pie labels with line caps.
Chart.Type = ChartType.Pie;
Chart.Size = "700x350";
Chart.TempDirectory = "temp";
Chart.Debug = false;
Chart.JS.Enabled = true;
Chart.PaletteName = Palette.WaterMeadow;
Chart.DefaultElement.SmartLabel.Line.StartCap = LineCap.Round;
Chart.DefaultElement.SmartLabel.PieLabelMode = PieLabelMode.Outside;
Chart.DefaultElement.SmartLabel.Text = "%name";
Chart.DefaultElement.Outline.Width = 1;//set color for each element to match outline color in legend entry
Chart.DefaultElement.ShowValue = true;
Chart.DefaultElement.ToolTip = "<b>%name</b><br>Population: <b>%value</b> (<b>%percentOfTotal%</b> of total population)<br><span style='width:300px;display:block;'>Countries: %countries</span>";
Chart.LegendBox.Visible = false;
DataEngine de = new DataEngine();
de.ChartObject = Chart; // Necessary to view any errors the dataEngine may throw.
de.Data = "./../../data/resources/population195.csv";
de.DataFields = "name=region,yAxis=population,splitby=region,country=countries";//cvs must have header
SeriesCollection sc = de.GetSeries();
Chart.SeriesCollection.Add(sc);
}
</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" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<%@ Import Namespace="System.Collections.Generic" %>
<script runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
' Demonstrates a styling variation of pie labels with line caps.
Chart.Type = ChartType.Pie
Chart.Size = "700x350"
Chart.TempDirectory = "temp"
Chart.Debug = False
Chart.JS.Enabled = True
Chart.PaletteName = Palette.WaterMeadow
Chart.DefaultElement.SmartLabel.Line.StartCap = LineCap.Round
Chart.DefaultElement.SmartLabel.PieLabelMode = PieLabelMode.Outside
Chart.DefaultElement.SmartLabel.Text = "%name"
Chart.DefaultElement.Outline.Width = 1 'set color for each element to match outline color in legend entry
Chart.DefaultElement.ShowValue = True
Chart.DefaultElement.ToolTip = "<b>%name</b><br>Population: <b>%value</b> (<b>%percentOfTotal%</b> of total population)<br><span style='width:300px;display:block;'>Countries: %countries</span>"
Chart.LegendBox.Visible = False
Dim de As DataEngine = New DataEngine()
de.ChartObject = Chart ' Necessary to view any errors the dataEngine may throw.
de.Data = "./../../data/resources/population195.csv"
de.DataFields = "name=region,yAxis=population,splitby=region,country=countries" 'cvs must have header
Dim sc As SeriesCollection = de.GetSeries()
Chart.SeriesCollection.Add(sc)
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 FilenameJsPieCsv.aspx
- Version10.0
- Uses DatabaseNo