Problem with AddArray function

TeeChart for ActiveX, COM and ASP
Post Reply
zizou5
Newbie
Newbie
Posts: 17
Joined: Mon Jun 11, 2007 12:00 am
Contact:

Problem with AddArray function

Post by zizou5 » Sun Apr 20, 2008 11:50 am

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?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Apr 21, 2008 8:25 am

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
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply