c# – 如何在线图中显示Oxyplot中的绘图点?

前端之家收集整理的这篇文章主要介绍了c# – 如何在线图中显示Oxyplot中的绘图点?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
这是我的图表的xaml代码
  1. <oxy:Plot HorizontalAlignment="Left"
  2. Height="222"
  3. Margin="0,49,0"
  4. VerticalAlignment="Top"
  5. Width="870"
  6. Background="Transparent"
  7. PlotAreaBorderColor="White"
  8. LegendBorder="Transparent"
  9. Name="viewCountPlot"
  10. Title="Videos Watched"
  11. TextColor="White" IsLegendVisible="False" IsManipulationEnabled="False" IsMouseWheelEnabled="False">
  12. <oxy:Plot.Axes>
  13. <oxy:DateTimeAxis Name="datetimeAxis" Position="Bottom" MajorGridlineColor="#40FFFFFF" TicklineColor="White" StringFormat="M/d/yy" IntervalType="Days" ShowMinorTicks="False"/>
  14. </oxy:Plot.Axes>
  15. <oxy:Plot.Series>
  16. <oxy:LineSeries
  17. Name="viewCountSeries"
  18. Title="Videos Viewed"
  19. DataFieldX="Date"
  20. DataFieldY="Value"
  21. Color="#CCFA6800"
  22. StrokeThickness="2"
  23. TrackerFormatString="Date: {2:M/d/yy}&#x0a;Value: {4}"
  24. ItemsSource="{Binding PlotItems}" MarkerStroke="#FFFDFDFD" />
  25. </oxy:Plot.Series>
  26. <oxy:Plot.DefaultTrackerTemplate>
  27. <ControlTemplate>
  28. <Canvas>
  29. <Grid Canvas.Left="{Binding Position.X}" Canvas.Top="{Binding Position.Y}">
  30. <Ellipse Fill="White" Width="12" Height="12" HorizontalAlignment="Left" VerticalAlignment="Top">
  31. <Ellipse.RenderTransform>
  32. <TranslateTransform X="-6" Y="-6" />
  33. </Ellipse.RenderTransform>
  34. </Ellipse>
  35. <TextBlock Foreground="{DynamicResource OrangeTextColor}" Text="{Binding}" Margin="-60 -40 0 0" />
  36. </Grid>
  37. </Canvas>
  38. </ControlTemplate>
  39. </oxy:Plot.DefaultTrackerTemplate>
  40. </oxy:Plot>

在情节系列中有没有办法将情节点显示为圆形或某种性质的东西?

这是我的意思的示例图像,每个绘图点都有一个与之关联的小圆:

解决方法

来自链接的讨论:

This should be covered by the Marker* properties in the LineSeries
See examples in the Example browser.

看起来你必须设置MarkerFill和MarkerType.要仅显示标记(并且不显示任何线条),请将“颜色”设置为“透明”.

  1. <oxy:LineSeries ItemsSource="{Binding MyDataPoints}"
  2. Color="Transparent"
  3. MarkerFill="SteelBlue"
  4. MarkerType="Circle" />

猜你在找的C#相关文章