Esempio n. 1
0
 private void FrmShowGraphic_Load(object sender, EventArgs e)
 {
     try
     {
         if (_dataSource != null)
         {
             GraphControl gc;
             Color[]      colors = new Color[_dataSource.Rows.Count];
             Random       random = new Random();
             for (int index = 0; index < _dataSource.Rows.Count; index++)
             {
                 int red   = random.Next(255);
                 int blue  = random.Next(255);
                 int green = random.Next(255);
                 colors[index] = Color.FromArgb(red, green, blue);
             }
             gc            = new CakyGraphControl(this.plBaseWorkArea, _selectStruct, _columns, colors, _dataSource, _itemName, 0);
             gc.GraphTitle = _title;
             gc.DrawGraph();
         }
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
 }
Esempio n. 2
0
        private void ShowGraph()
        {
            if (_managerDiary.HSFee == null)
            {
                return;
            }

            DataTable tbData = _managerDiary.HSFee;

            TableColumn[] columns = new TableColumn[1];
            columns[0].ColumnName  = "金额";
            columns[0].ColumnField = "TOTALFEE";
            GraphControl    gc;
            DataTableStruct datatablestruct = DataTableStruct.Rows;

            Color[] colors = new Color[tbData.Rows.Count];
            Random  random = new Random();

            for (int index = 0; index < tbData.Rows.Count; index++)
            {
                int red   = random.Next(255);
                int blue  = random.Next(255);
                int green = random.Next(255);
                colors[index] = Color.FromArgb(red, green, blue);
            }
            gc = new CakyGraphControl(this.pnlPictrue, datatablestruct, columns, colors, tbData, "ITEM_NAME", 0);
            string title = "医院收入示意图";

            gc.GraphTitle = title;
            gc.DrawGraph();
        }