示例#1
0
        public void DoLogon()
        {
            IntPtr  hwnd     = new System.Windows.Interop.WindowInteropHelper(Application.Current.MainWindow).Handle;
            tagRECT rcClient = new tagRECT();

            _pieCharIndex       = PieChartServer.AddPieChart(hwnd, rcClient);
            _lineCharIndex      = LineChartServer.AddCurveChart(hwnd, rcClient);
            _histogramCharIndex = HistogramServer.AddHistogramChart(hwnd, rcClient, 0, 3000, 300, Color.Red.ToArgb(), Color.Black.ToArgb(), Color.Green.ToArgb());
            _occupancyCharIndex = OccupancyChartServer.AddOccupancyChart(hwnd, rcClient, 0, 3000, 300);


            PieChartServer.AddData(_pieCharIndex, MainWindowViewModel._businesstype.Count - 1);
            LineChartServer.AddData(_lineCharIndex, 13, 12, 1200);
            HistogramServer.AddData(_histogramCharIndex, 12);
            OccupancyChartServer.AddData(_occupancyCharIndex, 12);

            PieChartServer.ShowPieList(_pieCharIndex, false);
            HistogramServer.ShowHistogramList(_histogramCharIndex, false);
            OccupancyChartServer.ShowOccupancyList(_occupancyCharIndex, false);
            ResizeShowCharts();

            Thread tQuery = new Thread(() =>
            {   ////循环查询
                QueryShebeiguzhang(null);
                QueryBenyuebanliyewu(null);
                QueryHongKongWangLai(null);
                QueryTaiWanWangLai(null);
                QuerySheBeiZaiXian(null);
                QueryGuanLiCiShu(null);
                QueryLineChartData(null);
                QueryOccupancyChartData(null);
                QueryPieChartData(null);
                QueryHistogramChartData(null);
            }
                                       );

            tQuery.IsBackground = true;
            tQuery.Start();
        }