private void DrawGraphic()
        {
            foreach (var timeSeries in _series.Values)
            {
                _scales.Add(timeSeries);
            }

            OnGetScales(_scales);

            List <Point>  p      = new List <Point>();
            List <string> labels = new List <string>();


            foreach (var scale in _scales.ScaleList)
            {
                int i = 0;
                p.AddRange(scale.GetPoint().Select(point =>
                {
                    labels.Add($"({point.X}, {point.Y}) - {scale.Name}");

                    return(new Point(i++, point.Y));
                }));
            }


            Diagram.Draw(p.ToArray(), Canvas, labels.ToArray());
        }
예제 #2
0
        private Scalies CreateScales(float[] centers)
        {
            Scalies scalies = new Scalies();

            //centers.ForEach(c => scalies.ScaleList.Add(new Scale()
            //{
            //    A = new Point(c - 50, 0),
            //    B = new Point(c, 1),
            //    C = new Point(c + 50, 0)
            //}));

            //_pointsX.ForEach(p => scalies.Add(p));

            foreach (var center in centers)
            {
                scalies.ScaleList.Add(new Scale()
                {
                    A = new Point(center - 50, 0),
                    B = new Point(center, 1),
                    C = new Point(center + 50, 0)
                });
            }

            foreach (var i in _pointsX)
            {
                scalies.Add(i);
            }

            return(scalies);
        }