WinRT Xaml 工具包列系列错误? [英] WinRT Xaml Toolkit Column Series Error?

查看:27
本文介绍了WinRT Xaml 工具包列系列错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个来自 Win RT Xaml Toolkit 的图表,我想显示这样的 ColumnSeries:

I have a Chart from Win RT Xaml Toolkit that I want to display a ColumnSeries like this:

<charting:Chart Name="columnChart" Grid.Row="1" Grid.Column="1" Width="400" Height="400">
    <charting:Chart.Series>
        <charting:ColumnSeries  
             ItemsSource="{Binding items}"
             IndependentValueBinding="{Binding Name}"
             DependentValueBinding="{Binding Value}" 
             IsSelectionEnabled="True">
        </charting:ColumnSeries>  
    </charting:Chart.Series>
</charting:Chart>

但我总是收到这个错误:

but I always receive this error:

WinRT 信息:无法添加类型实例'WinRTXamlToolkit.Controls.DataVisualization.Charting.ColumnSeries' 到类型的集合'System.Collections.ObjectModel.Collection'

WinRT information: Cannot add instance of type 'WinRTXamlToolkit.Controls.DataVisualization.Charting.ColumnSeries' to a collection of type 'System.Collections.ObjectModel.Collection<WinRTXamlToolkit.Controls.DataVisualization.Charting.ISeries>'

这可能是什么原因?

推荐答案

好的,我找到了,

错误是 ColumnSeries 缺少 Title 属性,如下所示:

The error was the ColumnSeries was missing the Title attribute, like this:

<charting:Chart Name="columnChart" Grid.Row="1" Grid.Column="1" Width="400" Height="400">
    <charting:Chart.Series>
        <charting:ColumnSeries  
             Title="Chart Title"
             ItemsSource="{Binding items}"
             IndependentValueBinding="{Binding Name}"
             DependentValueBinding="{Binding Value}" 
             IsSelectionEnabled="True">
        </charting:ColumnSeries>  
    </charting:Chart.Series>
</charting:Chart>

Title 属性似乎是强制性的.

It seems that the Title attribute is mandatory.

这篇关于WinRT Xaml 工具包列系列错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆