|
|
|
|
|
|
|
|
There are currently:
8 anonymous users online.
0 of 3,596 registered users online.
There have been 292485 Page Hits by
210466 users
|
|
|
|
|
Custom Colour Pie Charts
C# Example Code
{
string []lables = {"Red", "Green", "Orange", "Blue", "Yellow"};
System.Random r= new System.Random();
chart.Series[0].Type = ChartType.Pie;
chart.Legend.Visible = true;
chart.Series[0].Data.Add(new DataPoint(r.NextDouble()* 100, lables[0], Color.Red));
chart.Series[0].Data.Add(new DataPoint(r.NextDouble()* 100, lables[1], Color.Green));
chart.Series[0].Data.Add(new DataPoint(r.NextDouble()* 100, lables[2], Color.Orange));
chart.Series[0].Data.Add(new DataPoint(r.NextDouble()* 100, lables[3], Color.Blue));
chart.Series[0].Data.Add(new DataPoint(r.NextDouble()* 100, lables[4], Color.Yellow));
}
ASP.Net C# Example
<%@ Register tagPrefix="SasqChart" Namespace="SasqChart" Assembly="SasqChart" %>
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<HTML>
<HEAD>
<title>Simple C# SasqChart Example</title>
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
string []lables = {"Red", "Green", "Orange", "Blue", "Yellow"};
System.Random r= new System.Random();
chart.Series[0].Type = ChartType.Pie;
chart.Legend.Visible = true;
chart.Series[0].Data.Add(new DataPoint(r.NextDouble()* 100, lables[0], Color.Red));
chart.Series[0].Data.Add(new DataPoint(r.NextDouble()* 100, lables[1], Color.Green));
chart.Series[0].Data.Add(new DataPoint(r.NextDouble()* 100, lables[2], Color.Orange));
chart.Series[0].Data.Add(new DataPoint(r.NextDouble()* 100, lables[3], Color.Blue));
chart.Series[0].Data.Add(new DataPoint(r.NextDouble()* 100, lables[4], Color.Yellow));
}
</script>
</HEAD>
<body>
<SasqChart:WebChartControl id="chart" runat="server" width="600" height="400" />
</body>
</HTML>
|