Array input problem on C# ASP.NET OWC Chart

M

maz

Hello all, I already able to create OWC chart using tab-delimited input
strings, but problem raise when using arrays as the data inputs.

I have this C# ASP.NET code :
################
String r,w;
.....
## input arrays
string[] x = new string[20];
int[] y = new int[20];
......
### input string
r="b";w="10";
i=0;
while(i<20){
## test data
r=r+"\tb";w=w+"\t10";
x="a"; y=56;
i++;
}
.....
ChartSpace mychartspace = new ChartSpace(); mychartspace.Clear();
ChChart mychart = mychartspace.Charts.Add(0);
ChSeries myseries = mychart.SeriesCollection.Add(0);
.....
myseries.SetData(ChartDimensionsEnum.chDimCategories,(int)ChartSpecialDataSo
urcesEnum.chDataLiteral,r);
myseries.SetData(ChartDimensionsEnum.chDimValues,(int)ChartSpecialDataSource
sEnum.chDataLiteral,w);
.....
#####################

Everything run well when I use ineficient tab-delimited string "r" and "w"
as the input in SetData(). The chart show all data correctly. However, when
I use arrays "x" and "y" on SetData(), I get chart without values, only the
scale is displayed. Any suggestion?
 
H

happysoft

just useing it
object x= new object[] {"A", "B", "C"};
object y = new object[] {100, 120, 128};
maz said:
Hello all, I already able to create OWC chart using tab-delimited input
strings, but problem raise when using arrays as the data inputs.

I have this C# ASP.NET code :
################
String r,w;
....
## input arrays
string[] x = new string[20];
int[] y = new int[20];
.....
### input string
r="b";w="10";
i=0;
while(i<20){
## test data
r=r+"\tb";w=w+"\t10";
x="a"; y=56;
i++;
}
....
ChartSpace mychartspace = new ChartSpace(); mychartspace.Clear();
ChChart mychart = mychartspace.Charts.Add(0);
ChSeries myseries = mychart.SeriesCollection.Add(0);
....
myseries.SetData(ChartDimensionsEnum.chDimCategories,(int)ChartSpecialDataSo
urcesEnum.chDataLiteral,r);
myseries.SetData(ChartDimensionsEnum.chDimValues,(int)ChartSpecialDataSource
sEnum.chDataLiteral,w);
....
#####################

Everything run well when I use ineficient tab-delimited string "r" and "w"
as the input in SetData(). The chart show all data correctly. However, when
I use arrays "x" and "y" on SetData(), I get chart without values, only the
scale is displayed. Any suggestion?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top