예제 #1
0
파일: Form1.cs 프로젝트: takuminish/Kakeibo
        private void MoneyRangeMonth()
        {
            DateTime dtNow  = DateTime.Now;
            int      iMonth = dtNow.Month;

            chart1.Series.Clear();
            chart1.Series.Add("月別");

            chart1.Series["月別"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Column;
            string[] xValues = new string[12] {
                "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"
            };
            int[] yValues = new int[12] {
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            };

            ChartSet3(xValues, yValues, dtNow.Year);
            for (int i = 0; i < xValues.Length; i++)
            {
                //グラフに追加するデータクラスを生成
                System.Windows.Forms.DataVisualization.Charting.DataPoint dp = new System.Windows.Forms.DataVisualization.Charting.DataPoint();
                dp.SetValueXY(xValues[i], yValues[i]); //XとYの値を設定
                //   dp.IsValueShownAsLabel = true;  //グラフに値を表示するように指定
                chart1.Series["月別"].Points.Add(dp);    //グラフにデータ追加
            }
        }
예제 #2
0
        public void GerarDados()
        {
            ComboboxItem comboboxItem = (ComboboxItem)cboModeloAnalise.SelectedItem;

            if (chartItems != null)
            {
                chartItems.Clear();
            }

            switch (comboboxItem.Value)
            {
            case TipoAnalise.ChartUsuarios:
                chartItems = EstatisticaManager.GetAnaliseUsuarios(dataInicial.Value, dataFinal.Value, periodo);
                break;

            case TipoAnalise.ChartCategorias:
                chartItems = EstatisticaManager.GetAnaliseCategorias(dataInicial.Value, dataFinal.Value, grupoTransacoes);
                break;

            default:
                break;
            }
            chartAnalise.Series[0].Points.Clear();
            gridAnalise.DataSource = chartItems;

            foreach (Item item in chartItems)
            {
                var point = new System.Windows.Forms.DataVisualization.Charting.DataPoint();
                point.SetValueXY(item.Categoria, item.Valor);
                point.ToolTip = string.Format("{0}: {1}", item.Categoria, item.Valor);
                chartAnalise.Series[0].Points.Add(point);
            }

            chartAnalise.Titles[0].Text = "# " + comboboxItem.Text;
        }
예제 #3
0
파일: Form1.cs 프로젝트: takuminish/Kakeibo
        private void DaySelect()
        {
            DateTime day = GetSelectDate();

            if (day != DateTime.MaxValue)
            {
                chart1.Series.Clear();
                chart1.Series.Add("大分類別");

                chart1.Series["大分類別"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Column;
                string[] xValues = new string[] { "食費", "雑費", "住居" };
                int[]    yValues = new int[] { 0, 0, 0 };

                ChartSet(yValues, day);

                for (int i = 0; i < xValues.Length; i++)
                {
                    //グラフに追加するデータクラスを生成
                    System.Windows.Forms.DataVisualization.Charting.DataPoint dp = new System.Windows.Forms.DataVisualization.Charting.DataPoint();
                    dp.SetValueXY(xValues[i], yValues[i]);  //XとYの値を設定
                    //     dp.IsValueShownAsLabel = true;  //グラフに値を表示するように指定
                    chart1.Series["大分類別"].Points.Add(dp);   //グラフにデータ追加
                }
            }
        }
예제 #4
0
파일: Form1.cs 프로젝트: takuminish/Kakeibo
        private void Zandaka()
        {
            DateTime dtNow  = DateTime.Now;
            int      iMonth = dtNow.Month;

            chart1.Series.Clear();
            chart1.Series.Add("残高");

            chart1.Series["残高"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Column;
            string[] xValues = new string[31];
            int[]    yValues = new int[31];

            Chartinit4(xValues, yValues, dtNow);
            ChartSet4(xValues, yValues, dtNow);
            for (int i = 0; i < xValues.Length; i++)
            {
                //グラフに追加するデータクラスを生成
                System.Windows.Forms.DataVisualization.Charting.DataPoint dp = new System.Windows.Forms.DataVisualization.Charting.DataPoint();
                dp.SetValueXY(xValues[i], yValues[i]); //XとYの値を設定
                dp.IsValueShownAsLabel = true;         //グラフに値を表示するように指定
                chart1.Series["残高"].Points.Add(dp);    //グラフにデータ追加
            }
        }
예제 #5
0
파일: Form1.cs 프로젝트: takuminish/Kakeibo
        private void MoneyRangeDay()
        {
            DateTime dtNow  = DateTime.Now;
            int      iMonth = dtNow.Month;

            chart1.Series.Clear();
            chart1.Series.Add("日付別");

            chart1.Series["日付別"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Column;
            string[] xValues = new string[DateTime.DaysInMonth(dtNow.Year, dtNow.Month)];
            int[]    yValues = new int[DateTime.DaysInMonth(dtNow.Year, dtNow.Month)];

            Chartinit(xValues, yValues, dtNow.Year, dtNow.Month);
            ChartSet2(xValues, yValues, dtNow.Year, dtNow.Month);
            for (int i = 0; i < xValues.Length; i++)
            {
                //グラフに追加するデータクラスを生成
                System.Windows.Forms.DataVisualization.Charting.DataPoint dp = new System.Windows.Forms.DataVisualization.Charting.DataPoint();
                dp.SetValueXY(xValues[i], yValues[i]); //XとYの値を設定
                //      dp.IsValueShownAsLabel = true;  //グラフに値を表示するように指定
                chart1.Series["日付別"].Points.Add(dp);   //グラフにデータ追加
            }
        }
예제 #6
0
        public Form1()
        {
            string legend = "グラフ1";

            chart1.Series.Clear();                     //グラフ初期化

            chart1.Series.Add(legend);                 //グラフ追加
                                                       //グラフの種類を指定(Columnは棒グラフ)
            chart1.Series[legend].ChartType  = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Column;
            chart1.Series[legend].LegendText = legend; //凡例に表示するテキストを指定

            string[] xValues = new string[] { "A", "B", "C", "D", "E" };
            int[]    yValues = new int[] { 10, 20, 30, 40, 50 };

            for (int i = 0; i < xValues.Length; i++)
            {
                //グラフに追加するデータクラスを生成
                System.Windows.Forms.DataVisualization.Charting.DataPoint dp = new System.Windows.Forms.DataVisualization.Charting.DataPoint();
                dp.SetValueXY(xValues[i], yValues[i]); //XとYの値を設定
                dp.IsValueShownAsLabel = true;         //グラフに値を表示するように指定
                chart1.Series[legend].Points.Add(dp);  //グラフにデータ追加
            }
        }
예제 #7
0
        private void SetSpotChart()
        {
            DataGridViewRow row = dataAnalyzeAreaSets.CurrentRow;

            if (row == null)
            {
                return;
            }

            Cursor oldCursor = Cursor.Current;

            Cursor.Current   = Cursors.WaitCursor;
            labelStatus.Text = "";

            toolStripProgressBar1.Visible = true;
            toolStripProgressBar1.Maximum = this._Project.T;
            toolStripProgressBar1.Minimum = 1;

            AnalyzeAreaSet analyzeAreaSet = (AnalyzeAreaSet)row.DataBoundItem;

            chartSpot.Visible = true;
            chartSpot.Series.Clear();

            //グラフ設定
            string legend473Count = "473Count";
            string legend561Count = "561Count";
            string legendIntDen   = "IntDen";

            chartSpot.Series.Add(legend473Count);
            chartSpot.Series.Add(legend561Count);
            chartSpot.Series.Add(legendIntDen);

            chartSpot.Series[legend473Count].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
            chartSpot.Series[legend561Count].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
            chartSpot.Series[legendIntDen].ChartType   = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;

            chartSpot.Series[legend473Count].LegendText = legend473Count;
            chartSpot.Series[legend561Count].LegendText = legend561Count;
            chartSpot.Series[legendIntDen].LegendText   = legendIntDen;

            chartSpot.Series[legend473Count].IsValueShownAsLabel     = false;
            chartSpot.Series[legend473Count].SmartLabelStyle.Enabled = false;
            chartSpot.Series[legend473Count].LabelBorderDashStyle    = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.NotSet;
            chartSpot.Series[legend473Count].LabelBorderWidth        = 0;
            chartSpot.Series[legend473Count].LabelForeColor          = Color.FromArgb(0, 0, 0, 0);

            chartSpot.Series[legend561Count].IsValueShownAsLabel     = false;
            chartSpot.Series[legend561Count].SmartLabelStyle.Enabled = false;
            chartSpot.Series[legend561Count].LabelBorderDashStyle    = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.NotSet;
            chartSpot.Series[legend561Count].LabelBorderWidth        = 0;
            chartSpot.Series[legend561Count].LabelForeColor          = Color.FromArgb(0, 0, 0, 0);

            chartSpot.Series[legendIntDen].IsValueShownAsLabel     = false;
            chartSpot.Series[legendIntDen].SmartLabelStyle.Enabled = false;
            chartSpot.Series[legendIntDen].LabelBorderDashStyle    = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.NotSet;
            chartSpot.Series[legendIntDen].LabelBorderWidth        = 0;
            chartSpot.Series[legendIntDen].LabelForeColor          = Color.FromArgb(0, 0, 0, 0);

            chartSpot.Series[legendIntDen].YAxisType = System.Windows.Forms.DataVisualization.Charting.AxisType.Secondary;
            //


            string[] xValues         = new string[scrollT.Maximum];
            int[]    yValues473Count = new int[scrollT.Maximum];
            int[]    yValues561Count = new int[scrollT.Maximum];
            int[]    yValuesIntDen   = new int[scrollT.Maximum];

            for (int t = 1; t <= this._Project.T; t++)
            {
                xValues[t - 1] = t.ToString();

                double[] spots = this._Analyzer.AnalyzeSpot(analyzeAreaSet, t, (int)nudThreshold.Value);

                yValues473Count[t - 1] = (int)spots[0];
                yValues561Count[t - 1] = (int)spots[1];
                yValuesIntDen[t - 1]   = (int)spots[2];

                toolStripProgressBar1.Value = t;
                toolStripProgressBar1.PerformStep();
            }
            Spot spot = new Spot();

            spot._setCount473(yValues473Count);
            spot._setCount561(yValues561Count);
            spot._setIntDen(yValuesIntDen);
            this._Spot = spot;

            for (int i = 0; i < xValues.Length; i++)
            {
                System.Windows.Forms.DataVisualization.Charting.DataPoint dp473Count = new System.Windows.Forms.DataVisualization.Charting.DataPoint();
                System.Windows.Forms.DataVisualization.Charting.DataPoint dp561Count = new System.Windows.Forms.DataVisualization.Charting.DataPoint();
                System.Windows.Forms.DataVisualization.Charting.DataPoint dpIntDen   = new System.Windows.Forms.DataVisualization.Charting.DataPoint();

                dp473Count.SetValueXY(xValues[i], yValues473Count[i]);
                dp561Count.SetValueXY(xValues[i], yValues561Count[i]);
                dpIntDen.SetValueXY(xValues[i], yValuesIntDen[i]);

                dp473Count.IsValueShownAsLabel = true;
                dp561Count.IsValueShownAsLabel = true;
                dpIntDen.IsValueShownAsLabel   = true;

                chartSpot.Series["473Count"].Points.Add(dp473Count);
                chartSpot.Series["561Count"].Points.Add(dp561Count);
                chartSpot.Series["IntDen"].Points.Add(dpIntDen);
            }

            toolStripProgressBar1.Visible = false;
            Cursor.Current   = oldCursor;
            labelStatus.Text = "解析が完了しました";
            this._Flash      = "";

            buttonExportAsCSV.Enabled = true;
        }
예제 #8
0
        public void visualize()
        {
            artistlabel = 0;
            int    submax = 0;
            String legend = "結果";

            if (check == 0)
            {
                // グラフを追加
                chart1.Series.Add(legend);
                check++;
            }
            int[][] sub = new int[classnum][];
            for (int i = 0; i < classnum; i++)
            {
                sub[i] = new int[47];
            }
            for (int i = 0; i < classnum; i++)
            {
            }
            var min = int.MaxValue;
            var max = int.MinValue;

            //グラフの処理
            chart1.Series[legend].Points.Clear();
            chart1.Series[legend].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
            chart1.Legends.Clear();
            chart1.Series[legend].MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle;
            // xValuesとyValuesに、DB検索結果や計算結果等を、用途に応じて指定
            String[] xValues = new String[48];
            for (int i = 0; i < 48; i++)
            {
                string htime = (i / 2).ToString();
                string mtime = (i % 2 * 30).ToString();
                xValues[i] = htime + ":" + mtime;
            }
            int[][] yValues = new int[classnum][];
            for (int i = 0; i < classnum; i++)
            {
                yValues[i] = new int[48];
            }
            for (int i = 0; i < datanum; i++)
            {
                for (int j = 0; j < classnum; j++)
                {
                    if (tw[i].artist == artist[j])
                    {
                        for (int k = 0; k < 48; k++)
                        {
                            if (tw[i].tweettime == k && tw[i].tweetdate == date)
                            {
                                yValues[j][k]++;
                            }
                        }
                    }
                }
            }
            for (int i = 0; i < classnum; i++)
            {
                for (int j = 1; j < 48; j++)
                {
                    sub[i][j - 1] = yValues[i][j] - yValues[i][j - 1];
                }
            }
            for (int i = 0; i < classnum; i++)
            {
                foreach (var n in sub[i])
                {
                    if (min > n)
                    {
                        min = n;
                    }
                    if (max < n)
                    {
                        max = n;
                    }
                }
                if (i == 0)
                {
                    artistlabel = i;
                    submax      = max;
                }
                else
                {
                    if (max > submax)
                    {
                        submax      = max;
                        artistlabel = i;
                    }
                }
            }
            // 各ポイント毎のデータクラスを作成してグラフに反映
            for (int i = 0; i < xValues.Length; i++)
            {
                // DataPointクラスを作成
                System.Windows.Forms.DataVisualization.Charting.DataPoint dp = new System.Windows.Forms.DataVisualization.Charting.DataPoint();
                // XとYの値を指定
                dp.SetValueXY(xValues[i], yValues[artistlabel][i]);
                // グラフにポイントを追加
                chart1.Series[legend].Points.Add(dp);
            }
            label1.Text     = "注目アーティスト:" + imitationartist[artistlabel] + "のツイート推移";
            linkLabel1.Text = imitationartist[artistlabel];
        }