Example #1
0
        private void toolStripComboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            tabControl1.SelectedIndex = 2;
            //选择的兴趣点类型变化时,重新绘制图形
            List <string> typeList   = new List <string>();
            List <int>    numberList = new List <int>();
            List <double> ratioList  = new List <double>();

            var curPOI = pointinfor_2[toolStripComboBox1.SelectedIndex];

            foreach (var item in curPOI.crimeinfor)
            {
                typeList.Add(item.type);
                numberList.Add(item.number);
                ratioList.Add(Math.Round(
                                  (double)item.number / curPOI.number * 100, 3
                                  )
                              );
            }

            DrawChart.DrawPOI(ref chart1,
                              pointinfor_2[toolStripComboBox1.SelectedIndex].type);

            chart1.Series[0].Points.DataBindXY(typeList, numberList);
            chart1.Series[1].Points.DataBindXY(typeList, ratioList);
            //chart1.Series[0].Label = "#VAL";                //设置显示X Y的值
            chart1.Series[0].ToolTip = "type:#VALX\r\nnum:#VAL";  //鼠标移动到对应点显示数值
            chart1.Series[1].Label   = "#VAL";                    //设置显示X Y的值
            chart1.Series[1].ToolTip = "ratio:#VALX\r\nnum:#VAL"; //鼠标移动到对应点显示数值
        }
Example #2
0
        private void f函数图FToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DrawChart.ClearDataPoints_PointPatternAnalysis(ref chart1, this);

            chart1.ChartAreas[0].AxisX.Title = "d(m)";
            chart1.ChartAreas[0].AxisY.Title = "F(d)";
            chart1.Series[2].Points.DataBindXY(dList, FList);
        }
Example #3
0
        private void incidenttypeprimaryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DrawChart.ClearDataPoints_StatisticalAnalysis(ref chart1, this);
            chart1.Titles[0].Text = "各种犯罪类型的犯罪数量统计";

            //画犯罪类型分析图表
            chart1.Series[0].Enabled         = true;
            chart1.Series[1].Enabled         = false;
            chart1.Series[2].Enabled         = false;
            chart1.ChartAreas[0].AxisX.Title = "incident_type_primary";
            chart1.ChartAreas[0].AxisY.Title = "record_number";

            m_incident_type_primaryList.Sort();
            chart1.Series[0].Points.DataBindXY(m_incident_type_primaryList,
                                               m_incident_type_primary_numList);
            chart1.Series[0].Label   = "#VAL";                   //设置显示X Y的值
            chart1.Series[0].ToolTip = "type:#VALX\r\nnum:#VAL"; //鼠标移动到对应点显示数值
        }
Example #4
0
        private void dayofweekToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DrawChart.ClearDataPoints_StatisticalAnalysis(ref chart1, this);
            chart1.Titles[0].Text = "一周内不同日期犯罪数量统计";

            chart1.Series[0].Enabled         = false;
            chart1.Series[1].Enabled         = false;
            chart1.Series[2].Enabled         = true;
            chart1.ChartAreas[0].AxisX.Title = "day_of_week";
            chart1.ChartAreas[0].AxisY.Title = "record_number";

            m_day_of_weekList.Clear();
            for (int i = 1; i < comboBox3.Items.Count; i++)
            {
                m_day_of_weekList.Add(comboBox3.Items[i].ToString());
            }
            chart1.Series[2].Points.DataBindXY(m_day_of_weekList,
                                               m_day_of_week_numList);
            chart1.Series[2].Label   = "#VAL";                  //设置显示X Y的值
            chart1.Series[2].ToolTip = "day:#VALX\r\nnum:#VAL"; //鼠标移动到对应点显示数值
        }