columnseries chart data display problem?
<toolkit:chart grid.column="4" horizontalalignment="stretch" verticalalignment="stretch" x:name="chart1" title="chart title" legendtitle="legend"> <toolkit:chart.series> <toolkit:columnseries x:name="chartdata" itemssource="{binding}" title="abc" dependentvaluebinding="{binding price}" independentvaluebinding="{binding year}"> </toolkit:columnseries> </toolkit:chart.series> </toolkit:chart>
------------------------------
observablecollection<chart1> objchart = new observablecollection<chart1>();public mainpage(){
objchart.add(new chart1(){
year=
"2005",price=
"10"});
objchart.add(new chart1(){
year="2006",price=
"20"});
objchart.add(new chart1(){
year="2007",price=
"10"});
objchart.add(new chart1(){
year="2008",price=
"25"});
objchart.add(new chart1(){
year="2009",price=
"30"});
initializecomponent();
}
any body can tell me why data not display in chart column???
hi,
this 1 works me, please check if works on side, thanks:
<grid x:name="layoutroot" background="white" showgridlines="true"> <toolkit:chart x:name="chart1" title="chart title" legendtitle="legend"> <toolkit:chart.series> <toolkit:columnseries x:name="chartdata" itemssource="{binding}" title="abc" dependentvaluepath="price" independentvaluepath="year"> </toolkit:columnseries> </toolkit:chart.series> </toolkit:chart> </grid>
public partial class mainpage : usercontrol { observablecollection<chart1> objchart = new observablecollection<chart1>(); public mainpage() { initializecomponent(); objchart.add(new chart1() { year = "2005", price = 10 }); objchart.add(new chart1() { year = "2006", price = 20 }); objchart.add(new chart1() { year = "2007", price = 10 }); objchart.add(new chart1() { year = "2008", price = 25 }); objchart.add(new chart1() { year = "2009", price = 30 }); layoutroot.datacontext = objchart; } } public class chart1 { public string year { get; set; } public int price { get; set; } }
Silverlight > Programming Silverlight with .NET – General
Comments
Post a Comment