【问题标题】:How can I show the plot points in Oxyplot for a line Graph?如何在 Oxyplot 中为折线图显示绘图点?
【发布时间】:2014-02-28 17:00:11
【问题描述】:

这是我图表的 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}&#x0a;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>

在情节系列中,有什么方法可以将情节点显示为圆形或类似性质的东西?

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

【问题讨论】:

    标签: c# wpf oxyplot


    【解决方案1】:

    来自链接的讨论:

    这应该被LineSeries 中的Marker* 属性所覆盖 在示例浏览器中查看示例。

    看来您必须设置MarkerFillMarkerType。要仅显示标记(不显示行),请将 Color 设置为 Transparent

    <oxy:LineSeries ItemsSource="{Binding MyDataPoints}" 
                    Color="Transparent" 
                    MarkerFill="SteelBlue" 
                    MarkerType="Circle" />
    

    【讨论】:

      【解决方案2】:

      在 Oxyplot 论坛上为发现此问题的人提供答案。

      https://oxyplot.codeplex.com/discussions/528893

      【讨论】:

      • 此链接已失效
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-03
      相关资源
      最近更新 更多