Пример #1
0
        public async Task Update()
        {
            await SetModelData();

            Model1.InvalidatePlot(true);
        }
Пример #2
0
        //1本目のラインデータ
        // private List<DataPoint> dataPoints1;
        //public List<DataPoint> DataPoints1
        //{
        //    get { return dataPoints1; }
        //set { SetProperty(ref dataPoints1, value); }
        //}



        public void MakeChart()
        {
            // 発進停止診断
            // Create some data
            this.Items = new Collection <Item>
            {
                new Item {
                    Label = "ゆっくり発進", Value1 = 37, Value2 = 0, Value3 = 0
                },
                new Item {
                    Label = "安全停止", Value1 = 7, Value2 = 0, Value3 = 0
                },
                //new Item {Label = "Bananas", Value1 = 23, Value2 = 2, Value3 = 29}
            };

            // Create the plot model
            var tmp = new PlotModel
            {
                Title             = "発進停止診断",
                LegendPlacement   = LegendPlacement.Outside,
                LegendPosition    = LegendPosition.RightTop,
                LegendOrientation = LegendOrientation.Vertical
            };

            // Add the axes, note that MinimumPadding and AbsoluteMinimum should be set on the value axis.
            tmp.Axes.Add(new CategoryAxis {
                Position = AxisPosition.Left, ItemsSource = this.Items, LabelField = "Label"
            });
            tmp.Axes.Add(new LinearAxis {
                Position = AxisPosition.Bottom, MinimumPadding = 0, AbsoluteMinimum = 0
            });

            // Add the series, note that the BarSeries are using the same ItemsSource as the CategoryAxis.
            tmp.Series.Add(new BarSeries {
                ItemsSource = Items, ValueField = "Value1"
            });
            //tmp.Series.Add(new BarSeries { Title = "2010", ItemsSource = this.Items, ValueField = "Value2" });
            //tmp.Series.Add(new BarSeries { Title = "2011", ItemsSource = this.Items, ValueField = "Value3" });

            this.Model1 = tmp;

            Model1.InvalidatePlot(true);

            //this.DataContext = this;

            //チャート
            var model3 = new PlotModel
            {
                PlotType                = PlotType.Polar,
                PlotMargins             = new OxyThickness(0, 0, 0, 0),
                PlotAreaBorderThickness = new OxyThickness(0)
            };

            model3.Axes.Add(
                new AngleAxis
            {
                Minimum            = 0,
                Maximum            = 15,
                MajorStep          = 10,
                MinorStep          = 1,
                FormatAsFractions  = true,
                FractionUnit       = Math.PI,
                FractionUnitSymbol = "チャート"
            });
            model3.Axes.Add(new MagnitudeAxis());
            model3.Series.Add(new FunctionSeries(t => t, t => t, 0, Math.PI * 6, 0.01));

            Model3 = model3;
            Model3.InvalidatePlot(true);
        }