Page 1 of 1
Programatically setting chart data with Arguments or ArgumentsString not working
Posted: Mon Apr 16, 2012 11:34 pm
by aaronrc
I'm programatically adding some charts to my report as per
http://stimulsoft.helpserve.com/index.p ... d=49&nav=0. It works fine if I use a data source as in that example but if I try using the Arguments/Values properties or the ArgumentsString/ValuesString properties no data appears on the chart. Setting the ArgumentsString/ValuesString through the designer works. Example of failing report attached.
Programatically setting chart data with Arguments or ArgumentsString not working
Posted: Wed Apr 18, 2012 8:44 am
by HighAley
Hello.
aaronrc wrote:I'm programatically adding some charts to my report as per
http://stimulsoft.helpserve.com/index.p ... d=49&nav=0. It works fine if I use a data source as in that example but if I try using the Arguments/Values properties or the ArgumentsString/ValuesString properties no data appears on the chart. Setting the ArgumentsString/ValuesString through the designer works. Example of failing report attached.
To set Argument/Value properties you should use next code:
Code: Select all
item.Argument = new Stimulsoft.Report.Components.StiArgumentExpression("{Products.Categories.CategoryName}");
item.Value = new Stimulsoft.Report.Components.StiExpression("{2*Products.UnitPrice}");
And to set 'List of Values' and 'List of Arguments' properties you should use next code:
Code: Select all
item.ListOfArguments = new Stimulsoft.Report.Components.StiListOfArgumentsExpression("USA;England;Russia");
item.ListOfValues = new Stimulsoft.Report.Components.StiListOfValuesExpression("10;20;15");
Thank you.