Infragistics XamDataChart-Y轴上的时间跨度?

时间:2018-06-20 09:24:38

标签: c# wpf infragistics

如何在XamDataChart的Y轴上显示TimeSpan类型的标签?

我尝试这样做,但是看到非TimeSpan标签:

<ig:XamDataChart x:Name="DataChart" Grid.Row="1">
        <ig:XamDataChart.Axes>
            <ig:CategoryXAxis TickLength="5"
                              TickStrokeThickness="1"
                              TickStroke="Gray"
                              x:Name="XAxis"
                              Label="{}{CreateDate:HH:mm}"
                              ItemsSource="{Binding Data}"/>
            <ig:NumericYAxis TickLength="0"
                             TickStrokeThickness="1"
                             TickStroke="Gray"
                             Label="{}{ElapsedTimeString}"
                             x:Name="YAxis"/>
        </ig:XamDataChart.Axes>
        <ig:XamDataChart.Series>
            <ig:SplineSeries MarkerType="Circle" Thickness="2"
                             ItemsSource="{Binding Data}"
                             ValueMemberPath="ElapsedTime"
                             XAxis="{Binding ElementName=XAxis}"
                             YAxis="{Binding ElementName=YAxis}"/>
        </ig:XamDataChart.Series>
    </ig:XamDataChart>

我的数据模型是:

public class ProfileEntity
{
    public DateTime CreateDate { get; set; } // for axis X
    public TimeSpan ElapsedTime { get; set; } // for axis Y
}

我做错了什么?

0 个答案:

没有答案