예제 #1
0
파일: Dialog.cs 프로젝트: wolfedr/Finances
    private void button1_Click(object sender, System.EventArgs e)
    {
        try
        {
            double newValue = double.Parse(YValue.Text);
            if (newValue > 0)
            {
                ChartRef.Series[0].Points[pointIndex].YValues[0] = newValue;
            }
            else
            {
                ChartRef.Series[0].Points[pointIndex].YValues[0] = 0.5;
            }
        }
        catch
        {
        }

        ChartRef.Series[0].Points[pointIndex].Label = Label.Text;

        ChartRef.Series[0].Points[pointIndex].Color             = Color.FromName(PointColor.SelectedItem.ToString());
        ChartRef.Series[0].Points[pointIndex].BorderColor       = Color.FromName(BorderColor.SelectedItem.ToString());
        ChartRef.Series[0].Points[pointIndex].MarkerColor       = Color.FromName(MarkerColor.SelectedItem.ToString());
        ChartRef.Series[0].Points[pointIndex].MarkerBorderColor = Color.FromName(MarkerBorderColor.SelectedItem.ToString());

        ChartRef.Invalidate();

        this.Close();
    }
예제 #2
0
        private void SeriesValuesDataGrid_CurrentCellChanged(object sender, System.EventArgs e)
        {
            // Initializes a new instance of the DataView class
            DataView firstView = new DataView(dataSet1.Tables[0]);

            // since the DataView implements IEnumerable, pass the reader directly into
            //   the DataBind method with the name of the Columns selected in the query
            Chart1.Series["Series1"].Points.DataBindXY(firstView, "X", firstView, "Y");

            // Invalidate Chart
            Chart1.Invalidate();
        }
예제 #3
0
        void InitChart()
        {
            InitComp();
            chart1.Series.Clear();
            var series1 = new System.Windows.Forms.DataVisualization.Charting.Series
            {
                Name              = "Series1",
                Color             = System.Drawing.Color.Green,
                IsVisibleInLegend = false,
                IsXValueIndexed   = true,
                ChartType         = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line
            };

            this.chart1.Series.Add(series1);

            for (int i = 0; i < 100; i++)
            {
                series1.Points.AddXY(i, f(i));
            }
            chart1.Invalidate();
        }
예제 #4
0
        public void addData(byte[] data)
        {
            if (data == null)
            {
                return;
            }
            for (int x = 0; x < data.Length; x++)
            {
                sampleChart.Series["Series1"].Points.AddY(data[x]);
            }
            var chartArea = sampleChart.ChartAreas["ChartArea1"];

            chartArea.CursorX.AutoScroll = true;
            chartArea.AxisX.Minimum      = 0;
            chartArea.AxisX.Maximum      = 999;
            sampleChart.Invalidate();
            sampleChart.Update();
        }
예제 #5
0
        public void update(Queue <int> qt)
        {
            chart1.Series.Clear();
            var series1 = new System.Windows.Forms.DataVisualization.Charting.Series
            {
                Name              = "Series1",
                Color             = System.Drawing.Color.Green,
                IsVisibleInLegend = false,
                IsXValueIndexed   = true,
                ChartType         = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line
            };

            this.chart1.Series.Add(series1);

            lock (objlock)
            {
                for (int i = 0; i < qt.Count; i++)
                {
                    series1.Points.AddXY(i, qt.ElementAt(i));
                    i++;
                }
            }
            chart1.Invalidate();
        }
예제 #6
0
 public static void Refrescar(this System.Windows.Forms.DataVisualization.Charting.Chart oGrafico)
 {
     oGrafico.Invalidate();
     oGrafico.Update();
 }