1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Data;
|
---|
4 | using System.Configuration;
|
---|
5 | using System.Collections.Generic;
|
---|
6 | using System.Web;
|
---|
7 | using System.Web.Security;
|
---|
8 | using System.Web.UI;
|
---|
9 | using System.Web.UI.WebControls;
|
---|
10 | using System.Web.UI.WebControls.WebParts;
|
---|
11 | using System.Web.UI.HtmlControls;
|
---|
12 | using OpenFlashChart;
|
---|
13 |
|
---|
14 | public partial class datafile_stackbar : System.Web.UI.Page
|
---|
15 | {
|
---|
16 | protected void Page_Load(object sender, EventArgs e)
|
---|
17 | {
|
---|
18 | OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
|
---|
19 | chart.Title = new Title("Stack Bar");
|
---|
20 |
|
---|
21 | BarStack bar = new OpenFlashChart.BarStack();
|
---|
22 | List<BarStackValue> barStackValues = new List<BarStackValue>() ;
|
---|
23 | barStackValues.Add(2);
|
---|
24 | barStackValues.Add( new BarStackValue(3))
|
---|
25 | ;
|
---|
26 |
|
---|
27 | bar.AddStack(barStackValues);
|
---|
28 | List<BarStackValue> barStackValues1 = new List<BarStackValue>();
|
---|
29 | barStackValues1.Add(new BarStackValue(5,"#ef4565"));
|
---|
30 | barStackValues1.Add(new BarStackValue(3,"#876567"));
|
---|
31 |
|
---|
32 | bar.AddStack(barStackValues1);
|
---|
33 | chart.AddElement(bar);
|
---|
34 | chart.X_Axis.Steps = 4;
|
---|
35 | chart.X_Axis.Labels.Steps = 1;
|
---|
36 | chart.X_Axis.SetLabels( new string[]{"bar1","bar2"});
|
---|
37 | chart.X_Axis.Labels.Vertical = true;
|
---|
38 |
|
---|
39 | chart.X_Axis.Set3D(12);
|
---|
40 | chart.X_Axis.Offset = true;
|
---|
41 |
|
---|
42 | chart.Y_Axis.Set3D(3);
|
---|
43 | chart.Y_Axis.Steps = 4;
|
---|
44 |
|
---|
45 | string s = chart.ToPrettyString();
|
---|
46 | Response.Clear();
|
---|
47 | Response.CacheControl = "no-cache";
|
---|
48 | Response.Write(s);
|
---|
49 | Response.End();
|
---|
50 | }
|
---|
51 | }
|
---|