Example #1
0
        public void ResizeShowCharts()
        {
            tagRECT rect1 = new tagRECT();
            tagRECT rect2 = new tagRECT();
            tagRECT rect3 = new tagRECT();
            tagRECT rect4 = new tagRECT();

            MainWindowViewModel mainModel = Application.Current.MainWindow.DataContext as MainWindowViewModel;
            Window mainWnd = Application.Current.MainWindow;

            if (mainModel.bShowPage == PageVisibleEnum.PageVisibleEnum_SignStat)
            {
                double totalTitleHeight             = mainModel.titleheight + topHeight;
                System.Windows.Point ptOriginalDlg  = new System.Windows.Point(0, 0);
                System.Windows.Point ptTopLeftDlg1  = new System.Windows.Point(mainModel.leftWidth + leftListWidth, totalTitleHeight + regionTextHeight);
                System.Windows.Point ptBotRightDlg1 = new System.Windows.Point(mainWnd.Width, mainWnd.Height);

                ptOriginalDlg  = mainWnd.PointToScreen(ptOriginalDlg);
                ptTopLeftDlg1  = mainWnd.PointToScreen(ptTopLeftDlg1);
                ptBotRightDlg1 = mainWnd.PointToScreen(ptBotRightDlg1);

                rect1.left   = Convert.ToInt32(ptTopLeftDlg1.X - ptOriginalDlg.X);
                rect1.top    = Convert.ToInt32(ptTopLeftDlg1.Y - ptOriginalDlg.Y);
                rect1.right  = Convert.ToInt32(ptBotRightDlg1.X - ptOriginalDlg.X);
                rect1.bottom = Convert.ToInt32(ptBotRightDlg1.Y - ptOriginalDlg.Y);

                PieChartServer.MoveChart(_pieCharIndex, rect1, true);
                LineChartServer.MoveChart(_lineCharIndex, rect1, true);
                HistogramServer.MoveChart(_histogramCharIndex, rect1, true);
                switch (bShowChart)
                {
                case ShowChartEnum.ShowChartEnum_Pie:
                    region0Text = "制签饼图";
                    PieChartServer.ShowChart(_pieCharIndex, true);
                    LineChartServer.ShowChart(_lineCharIndex, false);
                    HistogramServer.ShowChart(_histogramCharIndex, false);
                    break;

                case ShowChartEnum.ShowChartEnum_Line:
                    region0Text = "制签统计图";
                    PieChartServer.ShowChart(_pieCharIndex, false);
                    LineChartServer.ShowChart(_lineCharIndex, true);
                    HistogramServer.ShowChart(_histogramCharIndex, false);
                    break;

                case ShowChartEnum.ShowChartEnum_Histogram:
                    region0Text = "制签直方图";
                    PieChartServer.ShowChart(_pieCharIndex, false);
                    LineChartServer.ShowChart(_lineCharIndex, false);
                    HistogramServer.ShowChart(_histogramCharIndex, true);
                    break;
                }
            }
            else
            {
                PieChartServer.ShowChart(_pieCharIndex, false);
                LineChartServer.ShowChart(_lineCharIndex, false);
                HistogramServer.ShowChart(_histogramCharIndex, false);
            }
        }
Example #2
0
        public void ResizeShowCharts()
        {
            tagRECT rect1 = new tagRECT();
            tagRECT rect2 = new tagRECT();
            tagRECT rect3 = new tagRECT();
            tagRECT rect4 = new tagRECT();

            MainWindowViewModel mainModel = Application.Current.MainWindow.DataContext as MainWindowViewModel;
            Window mainWnd = Application.Current.MainWindow;

            if (mainModel.bShowPage == PageVisibleEnum.PageVisibleEnum_Home)
            {
                double totalTitleHeight             = mainModel.titleheight + topHeight;
                System.Windows.Point ptOriginalDlg  = new System.Windows.Point(0, 0);
                System.Windows.Point ptTopLeftDlg1  = new System.Windows.Point(mainModel.leftWidth, totalTitleHeight + regionTextHeight);
                System.Windows.Point ptBotRightDlg1 = new System.Windows.Point(mainWnd.ActualWidth - regionRightWidth, mainWnd.ActualHeight);

                System.Windows.Point ptTopLeftDlg2  = new System.Windows.Point(mainWnd.ActualWidth - regionRightWidth, totalTitleHeight + regionTextHeight);
                System.Windows.Point ptBotRightDlg2 = new System.Windows.Point(mainWnd.ActualWidth, totalTitleHeight + (mainWnd.ActualHeight - totalTitleHeight) / 3);

                System.Windows.Point ptTopLeftDlg3  = new System.Windows.Point(mainWnd.ActualWidth - regionRightWidth, totalTitleHeight + (mainWnd.ActualHeight - totalTitleHeight) / 3 + regionTextHeight);
                System.Windows.Point ptBotRightDlg3 = new System.Windows.Point(mainWnd.ActualWidth, (mainWnd.ActualHeight - mainModel.titleheight - topHeight) * 2 / 3 + mainModel.titleheight + topHeight);

                System.Windows.Point ptTopLeftDlg4  = new System.Windows.Point(mainWnd.ActualWidth - regionRightWidth, totalTitleHeight + (mainWnd.ActualHeight - totalTitleHeight) * 2 / 3 + regionTextHeight);
                System.Windows.Point ptBotRightDlg4 = new System.Windows.Point(mainWnd.ActualWidth, mainWnd.ActualHeight);

                ptOriginalDlg  = mainWnd.PointToScreen(ptOriginalDlg);
                ptTopLeftDlg1  = mainWnd.PointToScreen(ptTopLeftDlg1);
                ptBotRightDlg1 = mainWnd.PointToScreen(ptBotRightDlg1);
                ptTopLeftDlg2  = mainWnd.PointToScreen(ptTopLeftDlg2);
                ptBotRightDlg2 = mainWnd.PointToScreen(ptBotRightDlg2);
                ptTopLeftDlg3  = mainWnd.PointToScreen(ptTopLeftDlg3);
                ptBotRightDlg3 = mainWnd.PointToScreen(ptBotRightDlg3);
                ptTopLeftDlg4  = mainWnd.PointToScreen(ptTopLeftDlg4);
                ptBotRightDlg4 = mainWnd.PointToScreen(ptBotRightDlg4);

                rect1.left   = Convert.ToInt32(ptTopLeftDlg1.X - ptOriginalDlg.X);
                rect1.top    = Convert.ToInt32(ptTopLeftDlg1.Y - ptOriginalDlg.Y);
                rect1.right  = Convert.ToInt32(ptBotRightDlg1.X - ptOriginalDlg.X);
                rect1.bottom = Convert.ToInt32(ptBotRightDlg1.Y - ptOriginalDlg.Y);
                rect2.left   = Convert.ToInt32(ptTopLeftDlg2.X - ptOriginalDlg.X);
                rect2.top    = Convert.ToInt32(ptTopLeftDlg2.Y - ptOriginalDlg.Y);
                rect2.right  = Convert.ToInt32(ptBotRightDlg2.X - ptOriginalDlg.X);
                rect2.bottom = Convert.ToInt32(ptBotRightDlg2.Y - ptOriginalDlg.Y);
                rect3.left   = Convert.ToInt32(ptTopLeftDlg3.X - ptOriginalDlg.X);
                rect3.top    = Convert.ToInt32(ptTopLeftDlg3.Y - ptOriginalDlg.Y);
                rect3.right  = Convert.ToInt32(ptBotRightDlg3.X - ptOriginalDlg.X);
                rect3.bottom = Convert.ToInt32(ptBotRightDlg3.Y - ptOriginalDlg.Y);
                rect4.left   = Convert.ToInt32(ptTopLeftDlg4.X - ptOriginalDlg.X);
                rect4.top    = Convert.ToInt32(ptTopLeftDlg4.Y - ptOriginalDlg.Y);
                rect4.right  = Convert.ToInt32(ptBotRightDlg4.X - ptOriginalDlg.X);
                rect4.bottom = Convert.ToInt32(ptBotRightDlg4.Y - ptOriginalDlg.Y);

                OccupancyChartServer.MoveChart(_occupancyCharIndex, rect2, true);
                switch (bShowChart)
                {
                case ShowChartEnum.ShowChartEnum_Pie:
                    region0Text = "已受理业务饼图表";
                    region2Text = "已受理业务统计图";
                    region3Text = "已受理业务直方图表";
                    PieChartServer.MoveChart(_pieCharIndex, rect1, true);
                    LineChartServer.MoveChart(_lineCharIndex, rect3, true);
                    HistogramServer.MoveChart(_histogramCharIndex, rect4, true);
                    break;

                case ShowChartEnum.ShowChartEnum_Line:
                    region0Text = "已受理业务统计图";
                    region2Text = "已受理业务饼图表";
                    region3Text = "已受理业务直方图表";
                    LineChartServer.MoveChart(_lineCharIndex, rect1, true);
                    PieChartServer.MoveChart(_pieCharIndex, rect3, true);
                    HistogramServer.MoveChart(_histogramCharIndex, rect4, true);
                    break;

                case ShowChartEnum.ShowChartEnum_Histogram:
                    region0Text = "已受理业务直方图表";
                    region2Text = "已受理业务统计图";
                    region3Text = "已受理业务饼图表";
                    HistogramServer.MoveChart(_histogramCharIndex, rect1, true);
                    LineChartServer.MoveChart(_lineCharIndex, rect3, true);
                    PieChartServer.MoveChart(_pieCharIndex, rect4, true);
                    break;
                }

                OccupancyChartServer.ShowChart(_occupancyCharIndex, true);
                PieChartServer.ShowChart(_pieCharIndex, true);
                LineChartServer.ShowChart(_lineCharIndex, true);
                HistogramServer.ShowChart(_histogramCharIndex, true);
            }
            else
            {
                OccupancyChartServer.ShowChart(_occupancyCharIndex, false);
                PieChartServer.ShowChart(_pieCharIndex, false);
                LineChartServer.ShowChart(_lineCharIndex, false);
                HistogramServer.ShowChart(_histogramCharIndex, false);
            }
        }