OxyPlot

Styling WPF OxyPlot PlotViews in XAML

喜夏-厌秋 提交于 2019-12-04 06:22:29
When setting up an OxyPlot plot view, you can either define the plot explicitly through various controls, or set it up through a binding to a PlotModel . As such, in the first case, the XAML for a plot of two LineSeries objects could look something like <oxy:Plot Title="Some plot"> <oxy:Plot.Axes> <oxy:LinearAxis Position="Left" /> <oxy:LinearAxis Position="Bottom" /> </oxy:Plot.Axes> <oxy:Plot.Series> <oxy:LineSeries ItemsSource="{Binding ActualSeriesData1}" DataFieldX="X" DataFieldY="Y"/> <oxy:LineSeries ItemsSource="{Binding ActualSeriesData2}" DataFieldX="X" DataFieldY="Y"/> </oxy:Plot

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

故事扮演 提交于 2019-12-04 03:57:07
Xamarin图表开发基础教程(4)OxyPlot框架 XamaminAndroid中绘制线图OxyPlotAndroidDemo 【示例1-1:OxyPlotAndroidDemo】下面实现线图的绘制。具体的操作步骤如下: (1)打开Xamarin.Android项目。 (2)将OxyPlot.Xamarin.Android组件添加到项目中的引入中。 (3)打开activity_main.axml文件,使用PlotView进行布局。代码如下: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <OxyPlot.Xamarin.Android.PlotView android:id="@+id/plot_view" android:layout_width=

How to refresh oxyplot plot when data changes

为君一笑 提交于 2019-12-03 15:03:19
问题 Oxyplot graphs 13 points which are derived from the 6 user input text boxes. The values in the text boxes are held in public variables in the MainWindow.xaml.cs class. The variables are updated when the user presses enter in the text box. How would I make the refresh button refresh the graph. private void RefreshButton_Click(object sender, RoutedEventArgs e) { //Refresh The Graph } I think that this would be done using the PlotModel.RefreshPlot() method, but I am not sure how to implement it

How can I show the plot points in Oxyplot for a line Graph?

做~自己de王妃 提交于 2019-12-03 14:13:26
Here is the xaml code to my graph: <oxy:Plot HorizontalAlignment="Left" Height="222" Margin="0,49,0,0" VerticalAlignment="Top" Width="870" Background="Transparent" PlotAreaBorderColor="White" LegendBorder="Transparent" Name="viewCountPlot" Title="Videos Watched" TextColor="White" IsLegendVisible="False" IsManipulationEnabled="False" IsMouseWheelEnabled="False"> <oxy:Plot.Axes> <oxy:DateTimeAxis Name="datetimeAxis" Position="Bottom" MajorGridlineColor="#40FFFFFF" TicklineColor="White" StringFormat="M/d/yy" IntervalType="Days" ShowMinorTicks="False"/> </oxy:Plot.Axes> <oxy:Plot.Series> <oxy

How to plot MULTIPLE LineSeries on an OxyPlot chart?

蹲街弑〆低调 提交于 2019-12-03 12:27:46
I apologize for asking so many OxyPlot questions, but I seem to be really struggling with using the OxyPlot chart control. My project is in WPF format so I was originally using a hosted WINFORMS chart and that worked like a charm and did absolutely everything I needed it to until I needed to overlay a WPF element on top of the hosted winform chart. Due to the "AirSpace" issue, I was not able to see the WPF element that I put on top of the hosted chart no matter what I did. That is when I decided to go with OxyPlot, which is giving me quite a few headache's so far. Here is my [origional

How to refresh oxyplot plot when data changes

家住魔仙堡 提交于 2019-12-03 04:45:18
Oxyplot graphs 13 points which are derived from the 6 user input text boxes. The values in the text boxes are held in public variables in the MainWindow.xaml.cs class. The variables are updated when the user presses enter in the text box. How would I make the refresh button refresh the graph. private void RefreshButton_Click(object sender, RoutedEventArgs e) { //Refresh The Graph } I think that this would be done using the PlotModel.RefreshPlot() method, but I am not sure how to implement it because of Oxyplot's poor documentation. I just updated to a new version of OxyPlot via NuGet. I'm

How I can get all colors in OxyPlot?

荒凉一梦 提交于 2019-12-02 21:44:12
问题 I have a one question. I use OxyPlot in WPF, C#. I need to have all colors to MarkerType and MarkerStroke for series. How I can get all colors? 回答1: Green, IndianRed, etc are static fields in static OxyColors class. use reflection to read all of them var colors = typeof(OxyColors) .GetFields(BindingFlags.Static | BindingFlags.Public) .Where(f => f.FieldType == typeof(OxyColor)) .Select(f => f.GetValue(null)) .Cast<OxyColor>() .ToList(); 来源: https://stackoverflow.com/questions/50602161/how-i

oxyplot axis locking center when mouse wheel

夙愿已清 提交于 2019-12-02 02:54:50
I'm new to wpf and oxyPlot. Now, I want create a dynamic line chart like an oscilloscope, but I don't know how to lock the axis on a value when mouse wheel zooms. Example: The red point is mouse location. In normal, zoom A -> B, zoom C -> D. now, I want to zoom C ->E, like mouse location at 0 center. I've found a solution that works for blocking an axis zoom center. You have to create a custom LinearAxis to achieve this: public class FixedCenterLinearAxis : LinearAxis { double center = 0; public FixedCenterLinearAxis() : base(){} public FixedCenterLinearAxis(double _center) : base() { center =

OxyPlot: How to use the axis label formatter and show Y labels?

ⅰ亾dé卋堺 提交于 2019-12-01 09:01:35
I'm using to Oxyplot for my Xamarin.iOS project for plotting a bar chart.. This is what my graph currently looks likes currently here's instead of x axis values which are numbers, I want to show sun, mon true, wed..... I can see that CategoryAxis has a method called LabelFormatter which returns Func<double, string> , but how do I use it? And also why are the Y-Axis labels not showing? public class MyClass { /// <summary> /// Gets or sets the plot model that is shown in the demo apps. /// </summary> /// <value>My model.</value> public PlotModel MyModel { get; set; } /// <summary> ///

Can't update OxyPlot graph after initialisation

蹲街弑〆低调 提交于 2019-12-01 08:45:24
I have a a OxyPlot chart definied in my XAML like this: <oxy:Plot Height="336"> <oxy:Plot.Series> <oxy:LineSeries ItemsSource="{Binding Chart}"/> </oxy:Plot.Series> </oxy:Plot> In the viewModel I have the following: public ObservableCollection<DataPoint> Chart { get; private set; } public MainViewModel() { Chart = new ObservableCollection<DataPoint>() { new DataPoint(12, 14), new DataPoint(20, 26) }; public void PriceChange(Model[] quotes) { for (int i = 0; i < quotes.Length; i++) { Chart.Add(new DataPoint(quotes[i].LastTradePrice, i*10)); } } } I can see the initial graph drawn for the