[7849] | 1 | using System;
|
---|
| 2 | using System.Data;
|
---|
| 3 | using System.Configuration;
|
---|
| 4 | using System.Collections.Generic;
|
---|
| 5 | using System.Web;
|
---|
| 6 | using System.Web.Security;
|
---|
| 7 | using System.Web.UI;
|
---|
| 8 | using System.Web.UI.WebControls;
|
---|
| 9 | using System.Web.UI.WebControls.WebParts;
|
---|
| 10 | using System.Web.UI.HtmlControls;
|
---|
| 11 | using OpenFlashChart;
|
---|
| 12 |
|
---|
| 13 | public partial class barsketch : System.Web.UI.Page
|
---|
| 14 | {
|
---|
| 15 | protected void Page_Load(object sender, EventArgs e)
|
---|
| 16 | {
|
---|
| 17 | OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
---|
| 18 | chart.Title = new Title("Sketch");
|
---|
| 19 |
|
---|
| 20 | BarSketch bar = new OpenFlashChart.BarSketch("#045","#4f1",4);
|
---|
| 21 | Random random = new Random();
|
---|
| 22 | bar.Colour = "#345";
|
---|
| 23 |
|
---|
| 24 | bar.FillAlpha = 0.4;
|
---|
| 25 | bar.Text = "Test";
|
---|
| 26 |
|
---|
| 27 | bar.FontSize = 10;
|
---|
| 28 | List<double> values = new List<double>();
|
---|
| 29 | List<string> labels = new List<string>();
|
---|
| 30 | for (int i = 0; i < 12; i++)
|
---|
| 31 | {
|
---|
| 32 | values.Add(random.Next(i, i * 2));
|
---|
| 33 | labels.Add(i.ToString());
|
---|
| 34 | }
|
---|
| 35 | bar.Values = values;
|
---|
| 36 | chart.AddElement(bar);
|
---|
| 37 | chart.X_Axis.Steps = 4;
|
---|
| 38 | chart.X_Axis.Labels.Steps = 4;
|
---|
| 39 | chart.X_Axis.SetLabels( labels);
|
---|
| 40 | chart.X_Axis.Labels.Vertical = true;
|
---|
| 41 |
|
---|
| 42 | chart.Y_Axis.Steps = 2;
|
---|
| 43 |
|
---|
| 44 |
|
---|
| 45 | Legend x = new Legend("x-axis legend");
|
---|
| 46 | chart.X_Legend = x;
|
---|
| 47 | string s = chart.ToString();
|
---|
| 48 | Response.Clear();
|
---|
| 49 | Response.CacheControl = "no-cache";
|
---|
| 50 | Response.Write(s);
|
---|
| 51 | Response.End();
|
---|
| 52 | }
|
---|
| 53 | }
|
---|