OxyPlot

Oxyplot Scatter Series InvalidatePlot(true) not working in WPF

試著忘記壹切 提交于 2019-12-11 10:42:48
问题 Currently I have a WPF with a single Oxyplot and three buttons that switch the data that will be displayed on the oxyplot. Each data set has three scatter series within it. So one PlotModel and three sets of three ScatterSeries Here is a pseudo code of what mine currently does. Please note that all DataLists contain different data so I know for a fact when the plot refreshes, the plot's not changing and not having the same value: XML: <Button Name="data1" Click="getData1"/> <Button Name=

How to draw rectangle over a plot?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 09:01:54
问题 Is it possible to draw rectangle using OxyPlot? Something like : or does OxyPlot not support this? 回答1: You can indeed. There's a couple of ways you can do it. I would prefer to use an annotation as this will also give you a highlighted background and give you the option to add click events on this area. There's probably a way to remove the highlight if you want to make it look like the image you've provided. var Event = new PolygonAnnotation(); Event.Layer = AnnotationLayer.BelowAxes; Event

Xamarin.Forms: Putting A Label Inside A PieChart Layout

落花浮王杯 提交于 2019-12-11 06:46:09
问题 Good Day. I'm creating a Xamarin.Forms Portable Application where I was able to display there a Chart using OxyPlot. My problem is how am I going to put a TOTAL SALES label in there. Because even if I put the Label in my .XAML page, it doesn't not appear. I want to put the Label there (inside the Red Border). What do you think I should do in order to have this? Here's my code: SalesViewModel.cs using OxyPlot; using OxyPlot.Series; using System; using System.Collections.Generic; using System

OxyPlot not showing in Xamarin Forms

强颜欢笑 提交于 2019-12-11 05:52:15
问题 There are dozens of issues about this particular problem, but none of the proposed solutions have worked for me. I cannot get OxyPlot to appear in iOS or Android. I've followed the setup instructions to add the various Init methods after Xamarin Forms init. What I have tried so far: Adding HeightRequest + WidthRequest Not putting it in a stack layout Adding a dummy variable after init Going to the latest unstable version via OxyPlot's nuget feed (https://www.myget.org/F/oxyplot) I am using

OxyPlot: how to hide left and top axis lines

随声附和 提交于 2019-12-11 00:38:04
问题 I'm using to Oxyplot for my Xamarin.iOS project for plotting a bar chart This is what my plot currently looks like Here I need to hide the Right and top axis I tried : model.Axes.Add(new LinearAxis() { Position = AxisPosition.Right, IsAxisVisible = false }); model.Axes.Add(new LinearAxis() { Position = AxisPosition.Top, IsAxisVisible = false }); But no effect.. Here's my full code public MyClass() { var model = new PlotModel { Title = "ColumnSeries" }; // A ColumnSeries requires a

Oxyplot: Prevent X-Axis label from overlapping

余生长醉 提交于 2019-12-10 23:09:58
问题 I'm plotting a ScatterPlot showing the last one month's data using OxyPlot. But the X axis labels are overlapping. X axis is a date time axis. Here's the function that I use to get X Axis. DateTimeAxis GetXAxis () { var axis = new DateTimeAxis { Position = AxisPosition.Bottom, MinorIntervalType = DateTimeIntervalType.Days, MinorTickSize = 0, MajorTickSize = 0, MajorGridlineStyle = LineStyle.None, MinorGridlineStyle = LineStyle.None, FontSize = 8, TextColor = OxyColor.Parse (ColorHex.DarkGray)

How to add new points to OxyPlot?

天大地大妈咪最大 提交于 2019-12-10 19:58:23
问题 This is the code that Oxyplot official page shows. namespace WpfApplication2 { using System.Collections.Generic; using OxyPlot; public class MainViewModel { public MainViewModel() { this.Title = "Example 2"; this.Points = new List<DataPoint> { new DataPoint(0, 4), new DataPoint(10, 13), new DataPoint(20, 15), new DataPoint(30, 16), new DataPoint(40, 12), new DataPoint(50, 12) }; } public string Title { get; private set; } public IList<DataPoint> Points { get; private set; } } } This is the

How to change OxyPlot Y-Axis string format?

坚强是说给别人听的谎言 提交于 2019-12-10 19:38:43
问题 Can anyone tell me how to change the Y axis string format?? I have Y-Axis percentages that I want to add the percent sign to. I am using OxyPlot to produce the chart in wpf. Here is my attempt, but it is NOT working: Func<double, string> formatFunc = (x) => string.Format("{000.00}%", x); formatFunc = new Func<double,string>("{0}"); // Add the plot to the window line.YAxis.LabelFormatter = formatFunc; This produces null reference error. Thanks! 回答1: This is an example I've used previously to

OxyPlot. How to change Format of values next to the axis from 1000 to 1k

我只是一个虾纸丫 提交于 2019-12-10 09:53:12
问题 Im trying to change the format of the value next to the axis from for example 1000 to 1k or 1000000 to 1M. Is this possible in LinearAxis? This is my Code: m.Axes.Add(new LinearAxis { Position = AxisPosition.Right, IsZoomEnabled = false, IsPanEnabled = false, Minimum = -(_maxPointValue2*0.1), Maximum = _maxPointValue2 + (_maxPointValue2*0.1), FontSize = 15, Key = "right", TickStyle = TickStyle.Outside, }); Is this perhaps possible with StringFormat? Also is it possible to change the TickStyle

Xamarin图表开发基础教程(7)OxyPlot框架

假如想象 提交于 2019-12-07 21:30:34
Xamarin图表开发基础教程(7)OxyPlot框架 Xamarin.Forms中使用OxyPlot框架 在Xamarin. Forms平台上实现图表显示需要完成以下的步骤: 1.添加OxyPlot.Xamarin.Forms组件 打开Xamarin.Forms项目,通过Nuget,将OxyPlot.Xamarin.Forms组件添加到各个子项目的引入项中。 2.初始化OxyPlot渲染器 在各个平台的子项目下,对OxyPlot渲染器进行初始化。其语法形式如下: OxyPlot.Xamarin.Forms.Platform.assignPlatform.PlotViewRenderer.Init(); 其中,assignPlatform指定的是各个子项目对应的平台,如果是Android子项目,这里的assignPlatform就是Android。 3.创建PlotView视图 创建PlotView视图的方式有两种,分别是在布局文件xaml中和在代码文件.cs中。下面将讲解这两种创建方式。 (1)在布局文件xaml文件中,创建PlotView视图的语法形式如下: <oxy:PlotView Model="*******" VerticalOptions="********" HorizontalOptions="********" …… /> 注意:在布局PlotView视图时