source: code/Website/dot-net-library/written-by-xiao-yifang/ofcWebTest/datafile/stackbar.aspx.cs@ 7937

Last change on this file since 7937 was 7849, checked in by dennisw, 15 years ago
File size: 1.6 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Data;
4using System.Configuration;
5using System.Collections.Generic;
6using System.Web;
7using System.Web.Security;
8using System.Web.UI;
9using System.Web.UI.WebControls;
10using System.Web.UI.WebControls.WebParts;
11using System.Web.UI.HtmlControls;
12using OpenFlashChart;
13
14public 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}
Note: See TracBrowser for help on using the repository browser.