Independent X,Y axes for each series?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
LG
Newbie
Newbie
Posts: 30
Joined: Tue Apr 08, 2003 4:00 am

Independent X,Y axes for each series?

Post by LG » Wed May 18, 2005 8:28 am

Dear All,

What I want to do is to use only one teechart control but I want to have a different X,Y Axes for each series. I would like to have it look like that each series X, Y axes are on each different TeeChart control.

Each X, Y axes are the same as they are in the seperate teechart control?

Could you please advise how to do this?

Regards,

LG

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

Post by Narcís » Wed May 18, 2005 9:23 am

Hi LG,

To achieve this you should use custom axes and position them wherever you want.

You will find information on how to use them at "Tutorial 4 - Axis Control". You will also find some examples at the TeeChart features demo. Both tutorials and features demo can be found at TeeChart program group.
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

LG
Newbie
Newbie
Posts: 30
Joined: Tue Apr 08, 2003 4:00 am

Post by LG » Wed May 18, 2005 10:13 am

Dear Narcis,

Thanks for your resply. That is not what I want to have at all.
Please find the sameple image that I use lot of controls to make it independent. But what I am asking is there anyway to use a single teeChart control and make it look the same what it is in my sample image?

Sorry that I could not upload the image to the forum. Could you please let me know if there anyway that I can send you the image?

Regards,

LG

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

Post by Narcís » Wed May 18, 2005 10:30 am

Dear LG,

Using custom axes doesn't mean having more than on TChart control. You can add several custom axes to a TChart control.

Regarding the image, please post it at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup. This will help us to figure out what you need.
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

LG
Newbie
Newbie
Posts: 30
Joined: Tue Apr 08, 2003 4:00 am

Post by LG » Wed May 18, 2005 11:51 am

Thanks for your link. I already posted the image.
Please have a look.


Regards,

LG

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Wed May 18, 2005 12:00 pm

Hi.
there anyway to use a single teeChart
Yes, if you use custom axes and additional legends for each series type.

But looking at the image you posted you basically want all charts to have the same "look" and alignment. I think this can be done by using several charts with (some) common properties.
One way to do this is to design new chart theme and apply it to all charts. Another (similar) solution is to create a chart template and then use it for all charts (an example about chart templates is available in TeeChart demo). Yet another way to left-align all charts is to set vertical axis properties (title size, label size, label separation, left margin) and thus ensure all charts will be left-aligned.
Marjan Slatinek,
http://www.steema.com

LG
Newbie
Newbie
Posts: 30
Joined: Tue Apr 08, 2003 4:00 am

Post by LG » Thu May 19, 2005 8:47 am

Dear Marjan,

I have problem as what you said on the left axis because some values in left axis are one digits, two digits, three, etc.

I could not find out any property used to set the left margin at all. Could you please advise how to align them properly even what ever number of digits? Could you please advise how to make sure all control are aligned both sides left & right?


Another problem I encounter by using candle.ColorEachLine = true seem not to work.

Code: Select all

ctrTChart.Series.Add(candle);
// adding X, Y values to chart
for (int intIndex=0;  intIndex<= adatTimeResult.GetUpperBound(0); intIndex++)
{	// add new line
if (astrValue[intIndex].ToLower() == "x")
   candle.Color  = Color.Green;
else if (astrValue[intIndex].ToLower() == "y")
   candle.Color = Color.Red;
else
  candle.Color = Color.Yellow;	// stand by
// add value
candle.Add(adatTimeResult[intIndex], 2, 3, 0, 1);
}
But somehow the color for each line doesn't work at all. It draws just one color.

Regards,

LG

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

Post by Narcís » Thu May 19, 2005 9:50 am

Dear LG,
I could not find out any property used to set the left margin at all. Could you please advise how to align them properly even what ever number of digits? Could you please advise how to make sure all control are aligned both sides left & right?
You could set the margins using:

Code: Select all

	this.tChart1.Panel.MarginUnits=Steema.TeeChart.PanelMarginUnits.Pixels;
			this.tChart1.Panel.MarginLeft=5;
			this.tChart1.Panel.MarginRight=5;
			this.tChart1.Panel.MarginTop=5;
			this.tChart1.Panel.MarginBottom5;
Another problem I encounter by using candle.ColorEachLine = true seem not to work.
You have to set ColorEach property to true:

Code: Select all

this.candle1.ColorEach=true;
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

LG
Newbie
Newbie
Posts: 30
Joined: Tue Apr 08, 2003 4:00 am

Post by LG » Thu May 19, 2005 10:14 am

Dear Narcís,

Thanks for your consistent help but I still cannot solve what I want to happen. This might be a not clear explanation from me. I already attached the sample image of what I want to do. Please have a look and advise.


Really appreciate your prompt helps so far.

LG

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

Post by Narcís » Thu May 19, 2005 10:30 am

Dear LG,

Ok, then you may need to set left axis position:

Code: Select all

	this.tChart1.Axes.Left.PositionUnits=Steema.TeeChart.PositionUnits.Pixels;
			this.tChart1.Axes.Left.Position=30;
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

LG
Newbie
Newbie
Posts: 30
Joined: Tue Apr 08, 2003 4:00 am

Post by LG » Thu May 19, 2005 10:48 am

Dear Narcis,

I am not sure why? I try but it say Position is a read-only property.
Please note that I create chart controls at run time.

Error message:

Code: Select all

Property or indexer 'Steema.TeeChart.Axis.Position' cannot be assigned to -- it is read only

Any suggestions?

Regards,

LG

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

Post by Narcís » Thu May 19, 2005 10:55 am

Dear LG,

Yes, sorry. You should use:

Code: Select all

	this.tChart1.Axes.Left.RelativePosition=10;
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

LG
Newbie
Newbie
Posts: 30
Joined: Tue Apr 08, 2003 4:00 am

Post by LG » Thu May 19, 2005 1:26 pm

Dear Narcís,

Sorry to tell you that it doesn't line up very well at all even I use the relative position. Could you advise any other solution please?


Another thing I have found that

Code: Select all

strTitle = "Hello";
line.Title = strTitle.PadRight(14, ' ')
When I pad it with a single space but when showing on the legend it always trim up. So there's no space at the end at all.

Is it a bug?

Regards,

LG

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Jun 16, 2005 9:58 am

Hi,
Sorry to tell you that it doesn't line up very well at all even I use the relative position. Could you advise any other solution please?
A solution is to set the same label size and title size for each Chart.

Code: Select all

tChart1.Axes.Left.Labels.CustomSize = 60;
tChart1.Axes.Left.Title.CustomSize = 20;
tChart2.Axes.Left.Labels.CustomSize = 60;			
tChart2.Axes.Left.Title.CustomSize = 20;
When I pad it with a single space but when showing on the legend it always trim up. So there's no space at the end at all.

Is it a bug?
Nope, it's by default (it removes the blank spaces at the end). Maybe you can add a dot or any other trick.

Post Reply