Custom labels - how to set axis increment
Custom labels - how to set axis increment
Hi
I have got custom labels on x axis and its a bar chart. Custom labels are a,b,c corresponding to 3 bars of chart. Now i want to increase space between 3 bars . If i do
Me.tcStraAssessRC.Axes.Bottom.Increment=20 it does not work as labels are not numeric.
So what can be the solution to achieve the same. Its very urgent, so a quick response will be highly appreciated. Thanks.
I have got custom labels on x axis and its a bar chart. Custom labels are a,b,c corresponding to 3 bars of chart. Now i want to increase space between 3 bars . If i do
Me.tcStraAssessRC.Axes.Bottom.Increment=20 it does not work as labels are not numeric.
So what can be the solution to achieve the same. Its very urgent, so a quick response will be highly appreciated. Thanks.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi shikha,
Please see my reply here.
However, if you are using custom labels you are already defining labels increment. Are you using custom labels as in the All Features\Welcome !\Axes\Labels\Custom labels example at the features demo, available at TeeChart’s program group?
Please see my reply here.
However, if you are using custom labels you are already defining labels increment. Are you using custom labels as in the All Features\Welcome !\Axes\Labels\Custom labels example at the features demo, available at TeeChart’s 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 |
Instructions - How to post in this forum |
Hi
Thanks for swift reply. However when i click the link "here" it takes me to profile page where i do not find the information. I am not adding as given in allfeatures. I am basically doing
barSeriesBase.Add(baseVal, POGRow("PogIDDesc"))
tcStraAssessRC.Series.Add(barSeriesBase)
it automatically takes POGRow("PogIDDesc") as labels on x axis and baseVal as the height of bar. But where to set the position of bar?
[/img]
Thanks for swift reply. However when i click the link "here" it takes me to profile page where i do not find the information. I am not adding as given in allfeatures. I am basically doing
barSeriesBase.Add(baseVal, POGRow("PogIDDesc"))
tcStraAssessRC.Series.Add(barSeriesBase)
it automatically takes POGRow("PogIDDesc") as labels on x axis and baseVal as the height of bar. But where to set the position of bar?
[/img]
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi shikha,
Sorry, I copied a wrong link. That was the one I wanted to paste:
http://www.teechart.net/support/viewtopic.php?t=8720
If this doesn't help 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.
Sorry, I copied a wrong link. That was the one I wanted to paste:
http://www.teechart.net/support/viewtopic.php?t=8720
If this doesn't help 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.
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 |
But my question is simple-
when we do this
tChart1.Series[0].Add(123, "ABC", Color.Red);
it creates a bar of 123 height as given in all featues\welcome\basi features. Now i just ant to know where we will set position(x axis ) of this bar. if we can do taht we can give more space between bars. i do not want to reduce width of bars.
when we do this
tChart1.Series[0].Add(123, "ABC", Color.Red);
it creates a bar of 123 height as given in all featues\welcome\basi features. Now i just ant to know where we will set position(x axis ) of this bar. if we can do taht we can give more space between bars. i do not want to reduce width of bars.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi shikha,
I'm not sure to understand what you are trying to achive. However, you can get bar position like this:
I'm not sure to understand what you are trying to achive. However, you can get bar position like this:
Code: Select all
int index = tChart1.Series[0].Add(123, "ABC", Color.Red);
tChart1.Draw();
int pos = tChart1.Series[0].CalcXPos(index);
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi shikha,
Ok, using the code in the example you mentioned:
Populates bar series automatically adding sequential X values like this:
X Bar
0 123
1 456
2 321
So to have longer intervals you can provide X and Y values, for example:
You can also try different axis offset combinations, for example:
Ok, using the code in the example you mentioned:
Code: Select all
tChart1.Series[0].Add(123, "ABC", Color.Red);
tChart1.Series[0].Add( 456, "DEF", Color.Blue );
tChart1.Series[0].Add( 321, "GHI", Color.Green );
X Bar
0 123
1 456
2 321
So to have longer intervals you can provide X and Y values, for example:
Code: Select all
tChart1.Series[0].Add(0, 123, "ABC", Color.Red);
tChart1.Series[0].Add(5, 456, "DEF", Color.Blue );
tChart1.Series[0].Add(10, 321, "GHI", Color.Green );
Code: Select all
tChart1.Axes.Bottom.MinimumOffset = -10;
tChart1.Axes.Bottom.MaximumOffset = -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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi shikha,
You're welcome.
Series.Add() method has several overloads. If you don't provide any X value (eg.: Series.Add(25)) it will add this point to Series.Count, Y. So in that case Series.Add(25) is the same as Series.Add(Series.Count, 25): In the example above:
X Bar
0 123
3 25
5 456
10 321
You're welcome.
Series.Add() method has several overloads. If you don't provide any X value (eg.: Series.Add(25)) it will add this point to Series.Count, Y. So in that case Series.Add(25) is the same as Series.Add(Series.Count, 25): In the example above:
X Bar
0 123
3 25
5 456
10 321
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 |