public void Open(string file)
        {
            var doc = new CsvDocument();

            doc.Load(file);
            var tmp = new PlotModel
            {
                Title           = Path.GetFileNameWithoutExtension(file),
                LegendPosition  = LegendPosition.RightTop,
                LegendPlacement = LegendPlacement.Outside,
                PlotMargins     = new OxyThickness(50, 0, 0, 40)
            };

            for (int i = 1; i < doc.Headers.Length; i++)
            {
                var ls = new LineSeries {
                    Title = doc.Headers[i]
                };
                foreach (var item in doc.Items)
                {
                    double x = this.ParseDouble(item[0]);
                    double y = this.ParseDouble(item[i]);
                    ls.Points.Add(new DataPoint(x, y));
                }

                tmp.Series.Add(ls);
            }

            tmp.Axes.Add(new LinearAxis {
                Position = AxisPosition.Bottom, Title = doc.Headers[0]
            });
            this.Model = tmp;
        }
Esempio n. 2
0
        public void Open(string file)
        {
            var doc = new CsvDocument();
            doc.Load(file);
            var tmp = new PlotModel
            {
                Title = Path.GetFileNameWithoutExtension(file),
                LegendPosition = LegendPosition.RightTop,
                LegendPlacement = LegendPlacement.Outside,
                PlotMargins = new OxyThickness(50, 0, 0, 40)
            };
            for (int i = 1; i < doc.Headers.Length; i++)
            {
                var ls = new LineSeries { Title = doc.Headers[i] };
                foreach (var item in doc.Items)
                {
                    double x = this.ParseDouble(item[0]);
                    double y = this.ParseDouble(item[i]);
                    ls.Points.Add(new DataPoint(x, y));
                }

                tmp.Series.Add(ls);
            }

            tmp.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom, Title = doc.Headers[0] });
            this.Model = tmp;
        }
Esempio n. 3
0
        public void Open(string file)
        {
            var doc = new CsvDocument();

            doc.Load(file);
            var tmp = new PlotModel(Path.GetFileNameWithoutExtension(file));

            tmp.LegendPosition  = LegendPosition.RightTop;
            tmp.LegendPlacement = LegendPlacement.Outside;
            tmp.PlotMargins     = new OxyThickness(50, 0, 0, 40);
            for (int i = 1; i < doc.Headers.Length; i++)
            {
                var ls = new LineSeries(doc.Headers[i]);
                foreach (var item in doc.Items)
                {
                    double x = ParseDouble(item[0]);
                    double y = ParseDouble(item[i]);
                    ls.Points.Add(new DataPoint(x, y));
                }
                tmp.Series.Add(ls);
            }
            tmp.Axes.Add(new LinearAxis(AxisPosition.Bottom, doc.Headers[0]));
            // tmp.Axes.Add(new LogarithmicAxis(AxisPosition.Left));
            Model = tmp;
        }
Esempio n. 4
0
 public void Open(string file)
 {
     var doc = new CsvDocument();
     doc.Load(file);
     var tmp = new PlotModel(Path.GetFileNameWithoutExtension(file));
     tmp.LegendPosition = LegendPosition.RightTop;
     tmp.LegendPlacement = LegendPlacement.Outside;
     tmp.PlotMargins= new OxyThickness(50,0,0,40);
     for (int i = 1; i < doc.Headers.Length; i++)
     {
         var ls = new LineSeries(doc.Headers[i]);
         foreach (var item in doc.Items)
         {
             double x = ParseDouble(item[0]);
             double y = ParseDouble(item[i]);
             ls.Points.Add(new DataPoint(x, y));
         }
         tmp.Series.Add(ls);
     }
     tmp.Axes.Add(new LinearAxis(AxisPosition.Bottom, doc.Headers[0]));
     // tmp.Axes.Add(new LogarithmicAxis(AxisPosition.Left));
     Model = tmp;
 }