Page 1 of 1

Which serie to choose in this case

Posted: Tue Jul 17, 2007 1:28 am
by 9343159
Hello

I have a case as following:

by a query, I can have following result:
//----------------------------
From To Traffic
USA GER 34
USA ESP 29
GER CHN 6
CHN ESP 5
.....
//----------------------------
So I want have a 3D display of the value ("traffic") from each "From" to each "To".

But when I search, it seems the X-value can not be a "string", it must be a float or integer.

So my question is:
1. Which kind of serie is most suitable for such case?
2. How to let X be a string value?

Posted: Tue Jul 17, 2007 9:17 am
by Pep
Hi,

do you have an example (image) of similar Chart than the one you're trying to accomplish ?
You can post it here as an image or on our news://www.steema.net/steema.public.attachments newsgroup.

Posted: Wed Jul 18, 2007 3:57 am
by 9343159
Hello

Here is a desired chart I have made through Excel.

[url]http://210.22.147.118/img_path/picture.jpg [/url]

To make this chart, I have to manually add many series. So I prefer using "one" TeeChart series to draw it.

Please notice that X and Z values are not of type of "number" but of "strings", however I find that now all AddXYZ requires X value as number.

Also also it could be better that a Dataset can be directly used with different fields set to X,Y,Z.

Posted: Wed Jul 18, 2007 9:12 am
by Pep
Hi,

the better Series type to generate this kind of Chart with TeeChart Pro would be to use the Surface Series, using the AddXYZ method allow you to add the data and specify a label for X axis (i.e. Series1.AddXYZ(x,y,z,label,color);).

To change the depth axis labels from values to text you will have to use the OnGetAxisLabel event, this allow you to customize each axis label.

The Series can be also populated directly from Dataset, assigning its ValueSource, labelSource,.. You can find some examples of this into the Demo Features project (included into the TeeChart Pro installer).

Posted: Thu Jul 19, 2007 1:01 am
by 9343159
Hello

That's why I need support.

The query looks like:
//-----start of query
select sum(traffic) as traffic, Origin, Dest from load group by Origin, Dest;
//-----end of query

So for the query result, field "traffic" is of float type, and field "Origin" and "Dest" are of string type.

I have decleared a Surface series with following code:
//---- start of code
Series1->DataSource=MyChartQuery;
Series1->XLabelsSource ="Origin";
Series1->XValues->ValueSource ="Origin";
Series1->YValues->ValueSource ="traffic";
Series1->ZValues->ValueSource ="Dest";
//--- end of code

Then I will have error as "is not a valid floating point value" for X and Z values.

I have to make a trick that to build internally two mapping list to convert X and Z values from string to integer, manually retrieve all the result in query and adding them one-by-one to the series, and also catch the OnGetAxisLabel event to convert the label back to string.

So I would like to ask if it is possible in TeeChart Pro, a series can do this automatically that
1. Directly linked to a Dataset
2. Allow X and Z value of type string

Posted: Thu Jul 19, 2007 4:41 am
by 9343159
BTW

It seems that OnGetAxisLabel may not help.

I have made a test to create a 32*32 3D series, so maximumly there are only 32 different X value.

However, after set the BottomAxis label type from "auto" to "text", through OnGetAxisLabel, the ValueIndex starts from -1 till 273!

So I have no way to correct convert to string value.

Posted: Mon Jul 30, 2007 10:16 am
by narcis
Hi easyblue,
So I would like to ask if it is possible in TeeChart Pro, a series can do this automatically that
1. Directly linked to a Dataset
2. Allow X and Z value of type string
I'm afraid this is not possible due to series structure which is described here.
I have made a test to create a 32*32 3D series, so maximumly there are only 32 different X value.

However, after set the BottomAxis label type from "auto" to "text", through OnGetAxisLabel, the ValueIndex starts from -1 till 273!

So I have no way to correct convert to string value.
Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.