c# - How to set ItemsSource value of ColumnSeries? -
i not able set itemssource
value of columnseries
. following examples (this , this) seem out dated.
here xaml
:
<charting:chart x:name="columnchart" horizontalalignment="center" verticalalignment="center" width="auto" height="auto"> <charting:columnseries title="georgi kyuchukov" margin="0" name="columnchartseries" independentvaluepath="name" dependentvaluepath="pts" isselectionenabled="true" /> </charting:chart>
and here c#
code:
public class chartdata { public string name { get; set; } public int pts { get; set; } } protected override void onnavigatedto(navigationeventargs e) { list<chartdata> personaldata = (list<chartdata>)e.parameter; foreach (chartdata x in personaldata){ debug.writeline(x.name + " " + x.pts); } (columnchart.series[0] columnseries).itemssource = personaldata; //columnchartseries.itemssource = personaldata; }
i getting following error:
error 1 type or namespace name 'columnseries' not found (are missing using directive or assembly reference?)
i have try:
columnchartseries.itemssource = personaldata;
but get:
an exception of type 'system.nullreferenceexception' occurred in gotqn.exe not handled in user code.
also, getting following error often:
error 1 value of type 'columnseries' cannot added collection or dictionary of type 'collection`1'.
but able run application, guess not critical.
could tell doing wrong?
also, grateful being given up-to-dated documentation link/article.
perhaps you're missing in code behind...
using winrtxamltoolkit.controls.datavisualization.charting;
try moving cursor columnseries
, press alt+shift+f10 add missing namespace. or use alt+enter if have resharper (which recommend).
Comments
Post a Comment