如何在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
}
我做错了什么?