using System;
using System.Data;
using System.Configuration;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using OpenFlashChart;
using XAxis=OpenFlashChart.XAxis;
using YAxis=OpenFlashChart.YAxis;

public partial class bar : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
        chart.Title = new Title("订单统计");

        Bar bar = new OpenFlashChart.Bar();
        Random random = new Random();
        bar.Colour = "#F7ACAF";
        
        bar.Alpha = 0.8;
        
        //bar.Text = "Test";
     
        bar.FontSize = 10;
        List<object> values = new List<object>();
        for (int i = 1; i < 13; i++)
        {
            BarValue barValue = new BarValue(random.Next(30000, 800000));
            barValue.OnClick = "http://www.v5shop.com.cn/";
            values.Add(barValue);
        }
        //BarValue barValue = new BarValue(584261);
        //barValue.OnClick = "http://www.v5shop.com.cn/";
        //values.Add(barValue);
        bar.Values = values;
        chart.AddElement(bar);
        XAxis xaxis = new XAxis();
        xaxis.Labels.SetLabels(new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月" });
        //xaxis.Steps = 1;
        //xaxis.Offset = true;
        ////xaxis.SetRange(-2, 15);
        chart.X_Axis = xaxis;
        //YAxis yaxis = new YAxis();
        //yaxis.Steps = 4;
        //yaxis.SetRange(0, 20);
        //chart.Y_Axis = yaxis;
        chart.Y_Axis.SetRange(0,800000,200000);
        bar.Tooltip = "#x_label#销售总额<br>订单总金额：#top#元<br>点击查看详细";
        string s = chart.ToPrettyString();

        Response.Clear();
        Response.CacheControl = "no-cache";
        Response.Write(s);
        Response.End();
    }
}
