private void RefreshChart() { int[] soundData = SoundUtil.ExtractFirstChunk(_audio.data, _audio.chunkSize); int sampleRate = _audio.sampleRate; Histogram.Series.Clear(); Histogram.Series.Add("Signal"); this.Text = "Signal"; Histogram.Series["Signal"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine; Histogram.Series["Signal"].MarkerSize = 2; float[] time = new float[soundData.Length]; float[] value = new float[soundData.Length]; for (int i = 0; i < soundData.Count(); i++) { value[i] = (float)soundData[i] / (float)sampleRate; time[i] = i / sampleRate; Histogram.Series["Signal"].Points.AddXY(time[i], value[i]); } Histogram.ChartAreas[0].AxisX.Title = "Time"; Histogram.ChartAreas[0].AxisY.Title = "Sample value"; }