Page 1 of 1
Independent X,Y axes for each series?
Posted: Wed May 18, 2005 8:28 am
by 8119968
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
Posted: Wed May 18, 2005 9:23 am
by narcis
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.
Posted: Wed May 18, 2005 10:13 am
by 8119968
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
Posted: Wed May 18, 2005 10:30 am
by narcis
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.
Posted: Wed May 18, 2005 11:51 am
by 8119968
Thanks for your link. I already posted the image.
Please have a look.
Regards,
LG
Posted: Wed May 18, 2005 12:00 pm
by Marjan
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.
Posted: Thu May 19, 2005 8:47 am
by 8119968
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
Posted: Thu May 19, 2005 9:50 am
by narcis
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:
Posted: Thu May 19, 2005 10:14 am
by 8119968
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
Posted: Thu May 19, 2005 10:30 am
by narcis
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;
Posted: Thu May 19, 2005 10:48 am
by 8119968
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
Posted: Thu May 19, 2005 10:55 am
by narcis
Dear LG,
Yes, sorry. You should use:
Code: Select all
this.tChart1.Axes.Left.RelativePosition=10;
Posted: Thu May 19, 2005 1:26 pm
by 8119968
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
Posted: Thu Jun 16, 2005 9:58 am
by Pep
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.