本文介绍了我怎样才能显示Oxyplot积点线图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是XAML代码到我的图:

Here is the xaml code to my graph:

<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>

在情节系列有什么办法来显示绘图点为圆形或类似这种事情?

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:

推荐答案

从链接的讨论:

这应该由标记*覆盖供LineSeries
属性请参见示例浏览器的例子。

看起来你必须设置 MarkerFill MarkerType 。要仅显示标记(无线),将颜色透明

It looks like you have to set MarkerFill and MarkerType. To show only markers (and no line), set the Color to Transparent.

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

这篇关于我怎样才能显示Oxyplot积点线图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 20:02