我有一个WPF应用程序,其中我需要可视化y= y(x1,x2),其中x1,x2是线性坐标。我可以使用Oxyplot中的HeatMapSeries来做这件事,但是当我想要在同一窗口中绘制两组数据时,热图不是合适的工具。几个轮廓线序列会更好。现在,我已经尝试用与HeatMapSeries相同的方式来实现这一点,效果非常好:
public void PlotHeatMap (){
OxyPlot.PlotModel model = new PlotModel { Title = "2-D data" };
model.Axes.Add( new OxyPlot.Axes
我必须在WPF项目中实现一个简单的柱状图输出。我为它选择了OxyPlot库。设计模式当然是MVVM。相关的源代码部分如下所示。当我运行这个项目时,我得到的是一个空图表,在x轴上有类别1到5(这是正确的),在y轴上有0到100的值(这也是正确的,因为我应该显示百分比)。
数据集合(类别轴的名称为“困难”,值轴的名称为“百分比”)“正确填充了值,我已经检查过了。
但是没有显示任何列。所以我想知道我做错了什么。我根据构建了我的示例,并基于我们在大学的wpf课堂上展示的一个示例。
有什么建议吗?
问候罗兰
using System;
using System.ComponentModel;
using
我有一个Wpf应用程序,它显示一个绘图视图,也有一个按钮,它调用一个函数,根据它的数据自动缩放绘图。我遇到的问题是,如果我使用键盘或鼠标平移/缩放与绘图视图交互,我的自动缩放按钮,它只是设置轴的最大值和最小值,并不会使绘图视图发生明显的变化。我已确认在对象本身中修改了最大值/最小值,但这些更改不会显示在绘图视图中。
public class ViewModel
{
public const int maxSamples = 45000;
public ViewModel()
{
this.PlotModel = new PlotModel();
我已经做了一个示例项目,试图修复这个错误,但没有运气。我做了一个简单的WPF应用程序,里面有一个Plot和一个Button。单击该按钮时,它会将X轴的最小值设置为100,将最大值设置为500。当我打开应用程序时,它可以工作,但一旦我平移/缩放图表,它就停止工作。
Minimum和ActualMinimum也是如此。下面是我的PlotModel代码和MainWindow代码。如果我的格式有问题,我深表歉意,我会尽快修复它。
public class OxyPlotModel : INotifyPropertyChanged
{
private OxyPlot.PlotM
AutoScale OxyPlot图表。例如,我有这样的东西。
using OxyPlot;
using OxyPlot.Axes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using S
我想在轴拖动之后动态添加点,但我如何才能弄清楚拖动轴是什么以及拖到了哪里?我可以得到显示的axes(x的起点和终点吗?
using OxyPlot;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
我想使用OXYPLOT库添加具有共享x轴的多个绘图。示例代码如下所示,它设置了4个不同的y轴,共享相同的x轴。然而,我只能在第一个x&y轴上绘制数据,而不能绘制其他轴上的数据。任何类型的建议都将不胜感激。
[Example("Untitled")]
public static PlotModel Untitled()
{
var plotModel1 = new PlotModel();
plotModel1.PlotMargins = new OxyThickness(40,20,40,30);
我想有一个按钮,当点击时,创建一个新的PlotView实例,并将其添加到StackPanel中。我该怎么做呢?
我试着想出一些办法,但没有用。到目前为止,我的代码如下:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
var plotView = new PlotView();
plotView.Height = 300;
plot
我正在使用xamarin在visual 2015中开发android。我想添加一个图表,因此为了基本理解,我跟踪了oxyplot并下载了文档(示例代码)。现在,我只是复制源代码,但通过编写代码。当我到达FindViewById<PlotView>(Resource.Id)点时,我在其中找不到Id字段。想要更好的理解,请看下面的图片和代码。
贝娄是我要复制的代码
using Android.App;
using Android.OS;
using OxyPlot.Xamarin.Android;
using OxyPlot;
using OxyPlot.Axes;
usi
我在使用动态数据生成oxyplot时遇到了一个问题。这是我第一次使用oxyplot处理动态数据。
public async Task<PlotModel> AreaChart_NoOfPoliciesAsync()
{
var plotModel1 = new PlotModel { Title = "Number of Policies with last year" };
plotModel1.InvalidatePlot(true);
try
{
var s1
我想从实时x-y坐标数据(使用OxyPlot)绘制等高线图。
我已经看过使用ContourSeries给出的示例,但我在理解如何实现轮廓时遇到了问题。
示例代码如下:
namespace ExampleLibrary
{
using System;
using OxyPlot;
using OxyPlot.Axes;
using OxyPlot.Series;
[Examples("ContourSeries"), Tags("Series")]
public class ContourSeriesExamples
{
private static
我可以使用IsAxisVisible = false移除轴,就像一样,但是当我这样做时,就不能再平移或缩放图形了。
图不平移的示例代码(使用Oxyplot2.0):
public class MainViewModel
{
public MainViewModel()
{
var tmp = new PlotModel { Title = "Simple example", Subtitle = "using OxyPlot" };
tmp.Axes.Add(new
我想用对数y标度在茎图中可视化1024个值。使用线性标度时,它工作得很好,但使用对数标度时,该图看起来很奇怪。我的代码或oxyplot中有没有bug?
我的词干图看起来像这样:
这是我的源代码:
var plotModel = new PlotModel { Title = "Stem Plot" };
plotModel.Axes.Clear();
if (yScalingType==(int)YScalingType.log)
{
L
我很难得到一个简单的线条图作为输出。我的工具栏上没有所有的工具。
InitializeComponent();
PlotModel model = new PlotModel();
OxyPlot.WindowsForms.PlotView plot1 = new OxyPlot.WindowsForms.PlotView();
var lineSeries = new LineSeries();
lineSeries.Points.Add(new DataPoint(0, 0))
lineSeries.Points.Add(new DataPoint(10, 4));
line
我不确定为什么在引用中有错误。OxyPlot.Wpf.LineSeries to OxyPlot.Series.Series System.Collections.ObjectModel.Collection.Add(OxyPlot.Axes.Axis)的最佳重载方法匹配具有一些无效参数。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OxyPlot;
using OxyPlot.Wpf;
usin
我想在我的windows窗体中停靠一个OxyPlot图形,并为函数y = 2x - 7绘制图形。我已经下载了OxyPlot并将引用添加到我的项目中。我使用以下代码将绘图添加到我的表单中:
public partial class GraphForm : Form
{
public OxyPlot.WindowsForms.Plot Plot;
public Graph()
{
InitializeComponent();
Plot = new OxyPlot.WindowsForms.Plot();
Plot.Mode