Custom labels - how to set axis increment

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Custom labels - how to set axis increment

Post by Neelam » Wed Nov 12, 2008 9:40 am

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.

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 Nov 12, 2008 9:46 am

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?
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

Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Post by Neelam » Wed Nov 12, 2008 10:37 am

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]

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 Nov 12, 2008 10:45 am

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.
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

Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Post by Neelam » Wed Nov 12, 2008 11:10 am

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.

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 Nov 12, 2008 11:17 am

Hi shikha,

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
Image Image Image Image Image Image
Instructions - How to post in this forum

Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Post by Neelam » Wed Nov 12, 2008 11:36 am

thanks but i think we are talking in different lines. i will try to again describe my Q:
I just want that the bars in bar chart should have more space inbetween without decreasing their width.

i am doing

tChart1.Series[0].Add(123, "ABC", Color.Red);

and then later add series to chart.

Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Post by Neelam » Wed Nov 12, 2008 11:40 am

in other words how add values to series in longer intervals (as you suggessted to do )

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 Nov 12, 2008 11:58 am

Hi shikha,

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 );
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:

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 );
You can also try different axis offset combinations, for example:

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
Image Image Image Image Image Image
Instructions - How to post in this forum

Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Post by Neelam » Wed Nov 12, 2008 12:04 pm

tHANKS THIS HELPS!!

JUST ONE MORE Q - INCASE I DO SOME THING LIKE

SERIES.ADD()

WHAT HAPPENS? WHERE WILL IT BE ADDED?

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 Nov 12, 2008 12:23 pm

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
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

Post Reply