这是我的图表的xaml代码:
<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:LineSeries
Name="viewCountSeries"
Title="Videos Viewed"
DataFieldX="Date"
DataFieldY="Value"
Color="#CCFA6800"
StrokeThickness="2"
TrackerFormatString="Date: {2:M/d/yy}
Value: {4}"
ItemsSource="{Binding PlotItems}" MarkerStroke="#FFFDFDFD" />
</oxy:Plot.Series>
<oxy:Plot.DefaultTrackerTemplate>
<ControlTemplate>
<Canvas>
<Grid Canvas.Left="{Binding Position.X}" Canvas.Top="{Binding Position.Y}">
<Ellipse Fill="White" Width="12" Height="12" HorizontalAlignment="Left" VerticalAlignment="Top">
<Ellipse.RenderTransform>
<TranslateTransform X="-6" Y="-6" />
</Ellipse.RenderTransform>
</Ellipse>
<TextBlock Foreground="{DynamicResource OrangeTextColor}" Text="{Binding}" Margin="-60 -40 0 0" />
</Grid>
</Canvas>
</ControlTemplate>
</oxy:Plot.DefaultTrackerTemplate>
</oxy:Plot>
Run Code Online (Sandbox Code Playgroud)
在情节系列中有没有办法将情节点显示为圆形或某种性质的东西? …
是否可以将绘图绑定到LineSeries集合而不是OxyPlot中的单个LineSeries?(而不是通过模型).
我正在寻找这样的东西:
<oxy:Plot>
<oxy:Plot.Series>
<oxy:LineSeries ItemsSource="{Binding myCollectionOfLineSeries}" />
</oxy:Plot.Series>
</oxy:Plot>
Run Code Online (Sandbox Code Playgroud)
myCollectionOfLineSeries的位置是:
private ObservableCollection<LineSeries> _myCollectionOfLineSeries ;
public ObservableCollection<LineSeries> myCollectionOfLineSeries
{
get
{
return _myCollectionOfLineSeries ;
}
set
{
_myCollectionOfLineSeries = value;
OnPropertyChanged("myCollectionOfLineSeries ");
}
}
Run Code Online (Sandbox Code Playgroud)
我希望得到答案:a)"不,这是不可能的"或b)"是的,只是把XYZ放在IJK之前".
谢谢阅读.
我在C#winforms应用程序中使用OxyPlot.我的axese是LinearAxis类型.
我试图绘制一些实时数据,我已经设法通过在我的系列中添加点并在数据可用时刷新绘图.但是,我无法弄清楚如何使用时间序列使曲线向右移动.
每个时间序列数据点的X值增加(int)1,我试图使用.Pan()来实现自动滚动:
xAxis.Pan(-1);
Run Code Online (Sandbox Code Playgroud)
显然这没有用,因为我假设该方法采用像素输入或其他东西,因此平移比数据增量慢得多.
我也尝试用-MajorTIckSize和-MajorStepSize替换-1而没有运气,因为这些通常都太小了.
我的问题是,我如何确定我需要用于平移真实数据的delta?我假设这将取决于缩放级别,显然它会很好,如果它会继续工作,因为我放大和缩小.我想解决方案涉及某种功能,依赖于滴答间隔的像素宽度或某事但我无法弄清楚.
PS:我也在OxyPlot讨论页面上问了这个问题
谢谢,
阿尔钦
我在 wpf 中使用 oxyplot 框架和 MVVM 模式。我想更改 x 轴标题,但找不到任何轴对象。PlotModel 中的 Axes 属性为空。我找到了 DefaultXaxis 属性,它也是空的。如何在不添加新轴的情况下更改默认轴标题。
提前致谢。
我正在使用 OxyPlot 来绘制特定时间范围内的数量。
我使用的 3 个不同时间范围的可能性是:
一天,两天到31天,1年到4年。
某一天,情节总是必须显示 0 到 24 小时。
对于两天到 31 天,我想设置例如第一天,比如 1 月 1 日,然后在下一个 1 月 15 日和最后一个 1 月 30 日。
对于一年到 4 年的时间,我想设置 4 个刻度,例如 2011 2012 2013 2014。
这是否可以通过设置开始和结束时间以及间隔和字符串格式以某种方式实现?
可以设置开始时间和结束时间吗?
我正在使用Oxyplot HeatMapSeries表示一些图形数据。对于新应用程序,我需要用等值面表示数据,如下所示:
有关此的一些想法:
我知道ContourSeries可以完成等值线,但找不到任何可以填补线条之间空白的选项。这个选项存在吗?
我知道HeatMapSeries可以显示在contourSeries下,因此我可以获得类似的结果,但它不符合我们的需求。
。
另一个选择是限制HeatMapSeries颜色并消除插值。这可能吗?
如果有人对解决方案有其他方法,我会听到的!
提前致谢!
如果我像这样用 c# 创建一个 DateTimeAxis:
DateTimeAxis xAxis = new DateTimeAxis
{
Position = AxisPosition.Bottom,
StringFormat = "dd/MM/yyyy",
Title = "Year",
MinorIntervalType = DateTimeIntervalType.Days,
IntervalType = DateTimeIntervalType.Days,
MajorGridlineStyle = LineStyle.Solid,
MinorGridlineStyle = LineStyle.None,
};
FunctionSeries fs = new FunctionSeries();
fs.Points.Add(new DataPoint(DateTimeAxis.ToDouble(DateTime.Now), 5));
fs.Points.Add(new DataPoint(DateTimeAxis.ToDouble(new DateTime(1989, 10, 3)), 8));
PlotModel n = new PlotModel();
n.Series.Add(fs);
n.Axes.Add(xAxis);
n.Axes.Add(new LinearAxis());
pv.Model = n;
Run Code Online (Sandbox Code Playgroud)
图表上的一切都很好,但是如果我按下该点,我会将此数据作为标签:
年份:0.#### X:6.2523
所以 X 信息是正确的,但我不知道为什么 oxyplot 没有显示正确的年份?
我目前正在使用 Oxyplot 和演示示例(可以在那里下载https://github.com/oxyplot/oxyplot/archive/develop.zip),尤其是示例“ColumnSeriesDemo”。
这是执行时的样子:
代码:
public MainWindow()
{
this.InitializeComponent();
// Create some data
this.Items = new Collection<Item>
{
new Item {Label = "Apples", Value1 = 37, Value2 = 12, Value3 = 19},
new Item {Label = "Pears", Value1 = 7, Value2 = 21, Value3 = 9},
new Item {Label = "Bananas", Value1 = 23, Value2 = 2, Value3 = 29}
};
// Create the plot model
var tmp = new PlotModel { Title = "Column series", LegendPlacement = …Run Code Online (Sandbox Code Playgroud) 我在我正在使用的基于PCL的项目中添加了OxyPlotAndroid和Core .XamarinMVVMCross
我在我的xml中添加了plotview,如下所示.但我不知道如何使用MVVMCross绑定此视图.
是否有任何好的例子或资源可供遵循?
MyView.xml
<oxyplot.xamarin.android.PlotView
android:id="@+id/plot"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Run Code Online (Sandbox Code Playgroud)
MyView.cs
public class MyView : MvxFragment<MyViewModel>
{
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
var ignored = base.OnCreateView(inflater, container, savedInstanceState);
var view = this.BindingInflate(Resource.Layout.MyView, null)
MyViewModel MyMainViewModel = new MyViewModel();
var a = view.FindViewById<PlotView>(Resource.Id.plot);
a.Model = MyViewModel.MyModel;
return view;
}
}
Run Code Online (Sandbox Code Playgroud)
MyViewModel.cs
public PlotModel MyModel { get; set; }
public MyViewModel
{
PlotModel mo = new PlotModel();
var s1 = new LineSeries()
{ …Run Code Online (Sandbox Code Playgroud)