Page 1 of 1

Problem with AddArray function

Posted: Sun Apr 20, 2008 11:50 am
by 9535497
Hi, I have chart with 12 Series. I am adding data to series via AddArray function. I can't add string array to my char on x ax.
Here is my source code:

int i;
int[][] poleInt = new int[12][];
string [] x = new string[1000];
// I have fill both arrays with sample values.

for (i = 0; i < 12; i++)
{
for (int j = 0; j < 1000; j++)
{
poleInt = new int[1000];
}
}

// I am filling Series like this:
for (i = 0; i < 12; i++)
{
{
TChart1.Series(i).AddArray(1000,poleInt,x);
}
}

And this is my problem: If x array is type int it is allright and chart is displayed, if x array is type string my application is crashed. I need string values on X ax.
I am programing in ASP.NET using C# language.

Could anyone help me please?

Posted: Mon Apr 21, 2008 8:25 am
by narcis
Hi zizou5,

First of all please notice that I have moved your message to the TeeChart Pro ActiveX forum as it seems to me you are using this version.

It is not possible to add strings for x values like this. You still need to supply numeric (integer or double) values for the X values and then also supply strings to be displayed in the x axis using AddXY method:

Code: Select all

function AddXY(AX, AY: Double; Const ALabel: WideString; Value: OLE_COLOR): Integer;
Then bottom axis labels will be automatically set to display text. You could also force them doing this:

Code: Select all

TChart1.Axis.Bottom.Labels.Style = talText