Automatic Bars size

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Pujol1986
Newbie
Newbie
Posts: 58
Joined: Thu Jan 29, 2009 12:00 am
Location: Barcelona
Contact:

Automatic Bars size

Post by Pujol1986 » Wed Feb 04, 2009 11:53 am

Hello,

I have a Gantt chart connected to a database, sometimes i need to show 10 bars and sometimes i need to show 60 bars.

How can i resize the bars Height automaticaly?

do i need to do this by calculations? or there is a gantt chart option to do this?

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 Feb 04, 2009 12:06 pm

Hi Pujol1986,

I think that if the axes in your chart are set to automatic scaling this should be also automatic:

Code: Select all

			tChart1.Axes.Left.Automatic = true;
			tChart1.Axes.Bottom.Automatic = true;
Does this help? How are the axes set up in your application?

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

Pujol1986
Newbie
Newbie
Posts: 58
Joined: Thu Jan 29, 2009 12:00 am
Location: Barcelona
Contact:

Post by Pujol1986 » Wed Feb 04, 2009 12:54 pm

Hi Narcís,

This is now my Gantt:

Image

And i need to see something like this:

Image

i take the second picture after change the offset property of the axis
offset = -466

in the first picture the offset was set to 5

i have the default configuratión for the axis, i tried the automatic scaling but didn't work.

do i need to change by calculation the offset of the chart? or there is another way to configure the gantt like in the second picture?

thanks.

AIS
Newbie
Newbie
Posts: 70
Joined: Wed Jun 25, 2008 12:00 am

Post by AIS » Wed Feb 04, 2009 1:02 pm

I dont know the behaviour of the gant series, but if you zoom into the chart with custombars (e.g. bar, horizbar) than the barwidth wouldnt be change automaticly. In that case, there can be one small bar within the chart. It seems not beautiful ;)

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 Feb 04, 2009 2:13 pm

Hi Pujol1986,

In that case it may help you setting bottom axis mininum and maximum values manually using its SetMinMax method, when you have populated your series, for example:

Code: Select all

		public Form1()
		{
			InitializeComponent();
			InitializeChart();
		}

		private void InitializeChart()
		{
			tChart1.Aspect.View3D = false;
			tChart1.Legend.Visible = false;

			Steema.TeeChart.Styles.Gantt gantt1 = new Steema.TeeChart.Styles.Gantt(tChart1.Chart);
			gantt1.FillSampleValues();
			tChart1.Axes.Bottom.SetMinMax(gantt1.StartValues.Minimum - 10, gantt1.EndValues.Maximum + 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

Pujol1986
Newbie
Newbie
Posts: 58
Joined: Thu Jan 29, 2009 12:00 am
Location: Barcelona
Contact:

Post by Pujol1986 » Wed Feb 04, 2009 3:08 pm

Thanks Narcís,

Finally i do this:

TChart2.Axes.Left.MaximumOffset = -Me.DataSet1.Tables(1).Rows.Count
TChart2.Axes.Left.MinimumOffset = -Me.DataSet1.Tables(1).Rows.Count

Post Reply