Teechart作图控件使用(data文件做数据源)

Teechart作图控件使用(data文件做数据源)private void InitializeChart(int heigth, int width, Color back_color_start, Color back_color_end, string chart_title, bool legend_visible, bool is_3d, bool isDate) 
Teechart作图控件使用(data文件做数据源)                { 
Teechart作图控件使用(data文件做数据源) 
Teechart作图控件使用(data文件做数据源)                        MyChart.Height = heigth; 
Teechart作图控件使用(data文件做数据源)                        MyChart.Width = width; 
Teechart作图控件使用(data文件做数据源)                        string path_virtual = HttpRuntime.AppDomainAppVirtualPath; 
Teechart作图控件使用(data文件做数据源)                        MyChart.GetChartFile = path_virtual + "/GetChart.aspx"
Teechart作图控件使用(data文件做数据源)                        MyChart.Chart.Axes.Left.AutomaticMinimum = true
Teechart作图控件使用(data文件做数据源)                        MyChart.Chart.Axes.Left.Minimum = 0; 
Teechart作图控件使用(data文件做数据源)                        this.MyChart.Chart.Axes.Left.Grid.Color = Color.FromArgb(0x75, 0x75, 0x75);    
Teechart作图控件使用(data文件做数据源)                        if (chart_title.Contains("局部")) 
Teechart作图控件使用(data文件做数据源)                        { 
Teechart作图控件使用(data文件做数据源)                                this.MyChart.Chart.Header.Text = jufangComPlantArr(chart_title)[0]; 
Teechart作图控件使用(data文件做数据源)                        } 
Teechart作图控件使用(data文件做数据源)                        else 
Teechart作图控件使用(data文件做数据源)                        { 
Teechart作图控件使用(data文件做数据源)                                this.MyChart.Chart.Header.Text = chart_title; 
Teechart作图控件使用(data文件做数据源)                        } 
Teechart作图控件使用(data文件做数据源)                        this.MyChart.Chart.Header.Transparent = true
Teechart作图控件使用(data文件做数据源)                        this.MyChart.Chart.Header.Transparency = 100; 
Teechart作图控件使用(data文件做数据源)                        this.MyChart.Chart.Header.Shadow.Visible = true
Teechart作图控件使用(data文件做数据源)                        this.MyChart.Chart.Header.Shadow.Transparency = 0; 
Teechart作图控件使用(data文件做数据源)                        this.MyChart.Chart.Legend.Visible = legend_visible; 
Teechart作图控件使用(data文件做数据源)                        this.MyChart.Chart.Legend.FontSeriesColor = true
Teechart作图控件使用(data文件做数据源)                        this.MyChart.Chart.Legend.Color = Color.Black; 
Teechart作图控件使用(data文件做数据源)                        this.MyChart.Chart.Legend.LegendStyle = LegendStyles.Series; 
Teechart作图控件使用(data文件做数据源)                        this.MyChart.Chart.Legend.Shadow.Color = Color.DarkGray; 
Teechart作图控件使用(data文件做数据源)                        this.MyChart.TempChart = TempChartStyle.Httphandler; 
Teechart作图控件使用(data文件做数据源)                        this.MyChart.Chart.Walls.Visible = true
Teechart作图控件使用(data文件做数据源)                        this.MyChart.Chart.Walls.Back.Height = 390; 
Teechart作图控件使用(data文件做数据源)                        this.MyChart.Chart.Walls.Back.Visible = true
Teechart作图控件使用(data文件做数据源)                        this.MyChart.Chart.Walls.Back.Gradient.StartColor = Color.FromArgb(0x4f, 0x4e, 0x55); 
Teechart作图控件使用(data文件做数据源)                        this.MyChart.Chart.Walls.Back.Gradient.EndColor = Color.FromArgb(0x4f, 0x4e, 0x55); 
Teechart作图控件使用(data文件做数据源)                        this.MyChart.Chart.Walls.Back.Gradient.MiddleColor = Color.FromArgb(0x4f, 0x4e, 0x55); 
Teechart作图控件使用(data文件做数据源) 
Teechart作图控件使用(data文件做数据源)                } 
Teechart作图控件使用(data文件做数据源) 
Teechart作图控件使用(data文件做数据源)//方法 
Teechart作图控件使用(data文件做数据源) 
Teechart作图控件使用(data文件做数据源)    public void draw(Table tb) 
Teechart作图控件使用(data文件做数据源)                { 
Teechart作图控件使用(data文件做数据源)                        MyChart = new WebChart(); 
Teechart作图控件使用(data文件做数据源)                        MyChart.ID = "chart1"
Teechart作图控件使用(data文件做数据源)                        InitializeChart(400, 700, System.Drawing.Color.FromArgb(254, 234, 234, 255), System.Drawing.Color.FromArgb(254, 234, 234, 255), "ceshi"truefalsetrue); 
Teechart作图控件使用(data文件做数据源)                         List<float> list = new List<float>(); 
Teechart作图控件使用(data文件做数据源)                        byte[] a = null
Teechart作图控件使用(data文件做数据源)                        byte[] bt = new byte[4]; 
Teechart作图控件使用(data文件做数据源)                        FileStream fs = new FileStream("G:\\51pt\\09-12-22-16-51-04-1C.dat", FileMode.Open); 
Teechart作图控件使用(data文件做数据源)                        a = new byte[fs.Length]; 
Teechart作图控件使用(data文件做数据源)                        fs.Read(a, 0, a.Length); 
Teechart作图控件使用(data文件做数据源)                        fs.Close(); 
Teechart作图控件使用(data文件做数据源)                        int j = 0; 
Teechart作图控件使用(data文件做数据源)                        for (int i = 0; i < a.Length; i++) 
Teechart作图控件使用(data文件做数据源)                        { 
Teechart作图控件使用(data文件做数据源)                                bt[j] = byte.Parse(a[i].ToString()); 
Teechart作图控件使用(data文件做数据源)                                j++; 
Teechart作图控件使用(data文件做数据源)                                if ((i + 1) % 4 == 0) 
Teechart作图控件使用(data文件做数据源)                                { 
Teechart作图控件使用(data文件做数据源)                                        j = (i + 1) % 4; 
Teechart作图控件使用(data文件做数据源)                                        Array.Reverse(bt); 
Teechart作图控件使用(data文件做数据源)                                        float f = BitConverter.ToSingle(bt, 0); 
Teechart作图控件使用(data文件做数据源)                                        list.Add(f); 
Teechart作图控件使用(data文件做数据源)                                } 
Teechart作图控件使用(data文件做数据源)                        } 
Teechart作图控件使用(data文件做数据源)                        Line l1 = new Line();    
Teechart作图控件使用(data文件做数据源)                        MyChart.Chart.Series.Add(l1); 
Teechart作图控件使用(data文件做数据源)                        for (int i = 0; i < list.Count; i++) 
Teechart作图控件使用(data文件做数据源)                        { 
Teechart作图控件使用(data文件做数据源)                                MyChart.Chart.Series[0].Add(Convert.ToDouble(i), Convert.ToDouble(list[i])); 
Teechart作图控件使用(data文件做数据源)                        } 
Teechart作图控件使用(data文件做数据源)                        TableRow tr = new TableRow(); ; 
Teechart作图控件使用(data文件做数据源)                        TableCell tc = new TableCell() ; 
Teechart作图控件使用(data文件做数据源)                        tc.Controls.Add(MyChart); 
Teechart作图控件使用(data文件做数据源)                        tr.Cells.Add(tc); 
Teechart作图控件使用(data文件做数据源)                        tb.Rows.Add(tr); 
Teechart作图控件使用(data文件做数据源)                } 
运行结果如下
Teechart作图控件使用(data文件做数据源)


本文转自 BruceAndLee 51CTO博客,原文链接:http://blog.51cto.com/leelei/308600,如需转载请自行联系原作者