[英]How can I show the plot points in Oxyplot for a line Graph?
Here is the xaml code to my graph: 这是我的图表的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>
In the plot Series is there any way to show the plot points as circles or something of that nature? 在情节系列中有没有办法将情节点显示为圆形或某种性质的东西?
Here is an example image of what I mean, each plot point has a small circle associated with it: 这是我的意思的示例图像,每个绘图点都有一个与之关联的小圆:
From the linked discussion: 来自链接的讨论:
This should be covered by the
Marker*
properties in theLineSeries
See examples in the Example browser.这应该由
LineSeries
的Marker*
属性覆盖。请参阅示例浏览器中的示例。
It looks like you have to set MarkerFill
and MarkerType
. 看起来你必须设置
MarkerFill
和MarkerType
。 To show only markers (and no line), set the Color
to Transparent
. 要仅显示标记(并且不显示线条),请将“
Color
设置为“ Transparent
。
<oxy:LineSeries ItemsSource="{Binding MyDataPoints}"
Color="Transparent"
MarkerFill="SteelBlue"
MarkerType="Circle" />
Answered on the Oxyplot forums for those who find this. 在Oxyplot论坛上回答了那些发现这个问题的人。
https://oxyplot.codeplex.com/discussions/528893 https://oxyplot.codeplex.com/discussions/528893
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.