Page 1 of 1
Automatic Bars size
Posted: Wed Feb 04, 2009 11:53 am
by 13051613
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.
Posted: Wed Feb 04, 2009 12:06 pm
by narcis
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.
Posted: Wed Feb 04, 2009 12:54 pm
by 13051613
Hi Narcís,
This is now my Gantt:
And i need to see something like this:
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.
Posted: Wed Feb 04, 2009 1:02 pm
by 13049497
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

Posted: Wed Feb 04, 2009 2:13 pm
by narcis
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);
}
Posted: Wed Feb 04, 2009 3:08 pm
by 13051613
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