public void Draw(int[] args) { int sum = args.Sum(); if (cartesianChart1.Series.Count() == 0) { cartesianChart1.Series.Add(new LineSeries { Title = "График", Values = new ChartValues <int>(args), PointGeometry = null }); cartesianChart1.AxisX.Add(new Axis { Title = "Каналы", Labels = MyFuncs.ArrGen <string>(255, "0", x => (Int32.Parse(x) + 1).ToString()) }); cartesianChart1.AxisY.Add(new Axis { Title = "импульсы/отн.ед", LabelFormatter = value => String.Format("{0:0} \\ {1:0.00} ", value, value / sum), }); } else { cartesianChart1.Series[0] = new LineSeries { Title = "График", Values = new ChartValues <int>(args), PointGeometry = null }; } }
private void Form1_Load(object sender, EventArgs e) { Random rnd = new Random(); Draw(MyFuncs.ArrGen <int>(255, rnd.Next(0, 100), x => rnd.Next(0, 100))); }