我有以下問題:
在我們的應用中有在運行時定義的子類別的報表列表...
報告的總體結果將顯示在一個的ColumnSeries ,它工作正常。現在,我必須在LineSeries中顯示子類別的結果以進行直接比較,這將不起作用。 這是我到目前爲止(在後面的代碼):Silverlight圖表工具包:生成供LineSeries拋出異常
foreach (var item in ReportListViewModel.ReportSections)
{
var series = new LineSeries();
series.SetBinding(DataPointSeries.ItemsSourceProperty, new Binding("ItemList"));
series.IndependentValuePath = "Date";
series.DependentValuePath = item.BindingPath; // points to an existing entry in a Dictionary<string, double>
series.Title = item.Text;
chart.Series.Add(series);
}
它工作正常,但一旦數據被加載時,我得到一個InvalidOperationException異常,說明密謀值沒有合適的軸被發現。
以下工作完全正常(即使它不正是我需要的):
foreach (...)
{
...
series.DependentValuePath = "Result" // Result is the dependent property of the ColumnSeries, and I tested it just to make sure it isn't me
...
}
可不可以給的「item.BindingPath」的值的例子嗎? – SalvadorGomez
''部分[人格]「' 正如我所說,這是一個字典<字符串,雙> {...,{」個性「,2.0},...} – Nuffin