|
|
|
|
|
|
|
|
There are currently:
3 anonymous users online.
0 of 3,596 registered users online.
There have been 292545 Page Hits by
210467 users
|
|
|
|
|
Custom Layout
C# Example Code
{
int width = (int)chart.Width.Value; // Hack. Assuming type = Pixel
int height = (int)chart.Height.Value; // Hack. Assuming type = Pixel
System.Random r= new System.Random();
chart.Header.Text = "Layout Example";
chart.Header.CustomRectangle = new Rectangle(5, 5, 80, 50);
chart.Header.Style.Font = new Font(FontFamily.GenericSerif, 14, FontStyle.Italic);
chart.Header.Style.FillColor = Color.Wheat;
chart.Legend.Visible = true;
chart.Legend.Style.Font = new Font(FontFamily.GenericSansSerif, 8);
chart.Legend.CustomRectangle = new Rectangle(width - 85, height-105, 80, 100);
chart.Legend.Style.FillColor = Color.FromArgb(0xE0, 0xE0, 0xE0);
chart.CustomRectangle = new Rectangle(25, 25, width-50, height-50);
chart.AxisStyle.FillColor = Color.FromArgb(0xE0, 0xE0, 0xE0);
chart.CanvasStyle.FillColor = Color.FromArgb(0xC0, 0xC0, 0xC0);
chart.ChartStyle.FillColor = Color.FromArgb(0xF0, 0xF0, 0xF0);
chart.OutputFormat = ImageFormat.Png;
int index = 0;
for(HatchStyle hatchStyle = HatchStyle.Percent10;
hatchStyle <= HatchStyle.Percent90;
hatchStyle+=2)
{
chart.Series[index].Type = ChartType.Bar;
chart.Series[index].Style.Type = SasqChart.Style.FillType.Hatch;
chart.Series[index].Style.HatchStyle = hatchStyle;
chart.Series[index].Name = hatchStyle.ToString();
chart.Series[index].Data.Add(new DataPoint(100.0 + (r.NextDouble() * 50.0)));
index++;
}
}
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)
{
int width = (int)chart.Width.Value; // Hack. Assuming type = Pixel
int height = (int)chart.Height.Value; // Hack. Assuming type = Pixel
System.Random r= new System.Random();
chart.Header.Text = "Layout Example";
chart.Header.CustomRectangle = new Rectangle(5, 5, 80, 50);
chart.Header.Style.Font = new Font(FontFamily.GenericSerif, 14, FontStyle.Italic);
chart.Header.Style.FillColor = Color.Wheat;
chart.Legend.Visible = true;
chart.Legend.Style.Font = new Font(FontFamily.GenericSansSerif, 8);
chart.Legend.CustomRectangle = new Rectangle(width - 85, height-105, 80, 100);
chart.Legend.Style.FillColor = Color.FromArgb(0xE0, 0xE0, 0xE0);
chart.CustomRectangle = new Rectangle(25, 25, width-50, height-50);
chart.AxisStyle.FillColor = Color.FromArgb(0xE0, 0xE0, 0xE0);
chart.CanvasStyle.FillColor = Color.FromArgb(0xC0, 0xC0, 0xC0);
chart.ChartStyle.FillColor = Color.FromArgb(0xF0, 0xF0, 0xF0);
chart.OutputFormat = ImageFormat.Png;
int index = 0;
for(HatchStyle hatchStyle = HatchStyle.Percent10;
hatchStyle <= HatchStyle.Percent90;
hatchStyle+=2)
{
chart.Series[index].Type = ChartType.Bar;
chart.Series[index].Style.Type = SasqChart.Style.FillType.Hatch;
chart.Series[index].Style.HatchStyle = hatchStyle;
chart.Series[index].Name = hatchStyle.ToString();
chart.Series[index].Data.Add(new DataPoint(100.0 + (r.NextDouble() * 50.0)));
index++;
}
}
</script>
</HEAD>
<body>
<SasqChart:WebChartControl id="chart" runat="server" width="600" height="400" />
</body>
</HTML>
|