2012-04-23 59 views
0

我想要在Windows Phone应用程序中显示一些数据。所以我使用这个命名空间的图表控件:System.Windows.Controls.DataVisualization.Toolkit。一切工作正常,但我想在x轴上显示另一个值,然后显示数字。在Windows Phone上绘制图形的一些问题

这是图表控件的XAML代码:

<charting:Chart x:Name="gluChart"> 
    <charting:Chart.LegendStyle> 
    <Style TargetType="datavis:Legend"> 
     <Setter Property="Width" Value="0"/> 
     <Setter Property="Height" Value="0"/> 
    </Style> 
    </charting:Chart.LegendStyle> 
    <charting:AreaSeries Name="gluLineChart" ItemsSource="{Binding}" IndependentValuePath="X" dependentValuePath="Y" BorderThickness="0"/> 
</charting:Chart> 

而且这是在代码隐藏文件(GlucoseItem是一个数据库,它允许保存日期,时间,价值和简单的项目注意):

List<Point> points = new List<Point>(); 
int i = 1; 
foreach (GlucoseItem gi in App.GluViewModel.AllGlucoseItems) 
{ 
    points.Add(new Point(i, Convert.ToDouble(gi.GlucoseValue))); 
    i++; 
} 
this.gluChart.DataContext = points; 

但现在我想在x轴上显示日期而不是数字。我该如何解决这个问题。而且我还有这个制图控制的另一个问题:它显示了一条蓝图,产生了制图控制,但我无法隐藏它。

回答