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?
Which serie to choose in this case
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.
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.
Pep Jorge
http://support.steema.com
http://support.steema.com
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.
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.
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).
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).
Pep Jorge
http://support.steema.com
http://support.steema.com
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
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
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.
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.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi easyblue,
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
I'm afraid this is not possible due to series structure which is described here.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
Could you please send us a simple example project we can run "as-is" to reproduce the problem 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.
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |