Page 1 of 1
missing label in chart
Posted: Thu Jun 18, 2009 2:01 pm
by 9641173
Hi,
I have another problem.
we are using Gantt labels and add the data like this:
gLabel.Add( start, end, k, configuration );
I can see that "configuration" is set if I debug the code.
But with more than one entry the label is not shown in the chart.
I attached a screen shot.
I have no idea why the label isn't shown and hope you can help me.
Thanks,
Daniela
Re: missing label in chart
Posted: Fri Jun 19, 2009 9:32 am
by yeray
Hi daniela,
It would be helpful if you could send us a code sniped or a simple project we can run as-is here to reproduce the problem and try to find a solution.
Thanks in advance.
Re: missing label in chart
Posted: Fri Jun 19, 2009 9:42 am
by 10050769
Hello daniela,
I make a simple example using custom labels, and I think that will help you to solve your problem:
Code: Select all
private void InitializeChart()
{
Steema.TeeChart.Styles.Gantt gantt1 = new Steema.TeeChart.Styles.Gantt(tChart1.Chart);
gantt1.FillSampleValues(10);
tChart1.Axes.Left.Labels.Items.Clear();
for (int i = 0; i < gantt1.Count; i++)
{
tChart1.Axes.Left.Labels.Items.Add(gantt1.YValues[i], gantt1.Labels[i]);
}
}
}
Please, check code works fine in your application.
Thanks,
Re: missing label in chart
Posted: Fri Jun 19, 2009 1:02 pm
by 9641173
Hi,
I made a small example:
private void InitializeChart()
{
for ( int i = 0; i < 2; i++ )
{
Steema.TeeChart.Styles.Gantt gantt1 = new Gantt();
Gantt gLabel = new Gantt();
tChart1.Series.Add( gLabel );
DateTime fstart = new DateTime( 2009, 6, 19, i, 0, 0 );
DateTime fend = new DateTime( 2009, 6, 19, i,1, 0 );
gLabel.Add( fstart, fend, i, "test" + i.ToString() );
fstart = new DateTime( 2009, 6, 19, i, 5, 0 );
fend = new DateTime( 2009, 6, 19, i, 6, 0 );
gLabel.Add( fstart, fend, i, "test" + i.ToString() );
fstart = new DateTime( 2009, 6, 19, i, 20, 0 );
fend = new DateTime( 2009, 6, 19, i, 21, 0 );
gLabel.Add( fstart, fend, i, "test" + i.ToString() );
}
tChart1.Refresh();
}
}
I get the attached chart, the second gLabel "test1" is missing.
Re: missing label in chart
Posted: Fri Jun 19, 2009 3:18 pm
by yeray
Hi
I've modified your code introducing a little variant of the code that Sandra suggested to you and it seems to work fine here:
Code: Select all
private void InitializeChart()
{
for ( int i = 0; i < 2; i++ )
{
//Steema.TeeChart.Styles.Gantt gantt1 = new Gantt();
Gantt gLabel = new Gantt();
tChart1.Series.Add( gLabel );
DateTime fstart = new DateTime( 2009, 6, 19, i, 0, 0 );
DateTime fend = new DateTime( 2009, 6, 19, i,1, 0 );
gLabel.Add( fstart, fend, i, "test" + i.ToString() );
fstart = new DateTime( 2009, 6, 19, i, 5, 0 );
fend = new DateTime( 2009, 6, 19, i, 6, 0 );
gLabel.Add( fstart, fend, i, "test" + i.ToString() );
fstart = new DateTime( 2009, 6, 19, i, 20, 0 );
fend = new DateTime( 2009, 6, 19, i, 21, 0 );
gLabel.Add( fstart, fend, i, "test" + i.ToString() );
}
tChart1.Axes.Left.Labels.Items.Clear();
for (int i = 0; i < tChart1.Series.Count; i++)
{
tChart1.Axes.Left.Labels.Items.Add(tChart1[i].YValues[0], tChart1[i].Labels[0]);
}
tChart1.Refresh();
}
Re: missing label in chart
Posted: Mon Jun 22, 2009 12:30 pm
by 9641173
Thanks a lot, it works with the additional code
Code: Select all
tChart1.Axes.Left.Labels.Items.Clear();
for (int i = 0; i < tChart1.Series.Count; i++)
{
tChart1.Axes.Left.Labels.Items.Add(tChart1[i].YValues[0], tChart1[i].Labels[0]);
}
tChart1.Refresh();
Re: missing label in chart
Posted: Mon Sep 27, 2010 11:57 am
by 9530487
I'm hitting this bug now. Is it going to be fixed soon?
Seems that if the title for the plot is not in series 0, it does not get displayed on the left/right hand axis.
The only way around is to set up the custom axis labels first, then set up the plots.
Visual basic example below.
TChart1.AddSeries scGantt
TChart1.AddSeries scGantt
TChart1.Aspect.View3D = False
' Disable automatic sorting by date
TChart1.Series(0).XValues.Order = loNone
TChart1.Series(1).XValues.Order = loNone
' Fill Gantt with sample date-time values:
With TChart1.Series(0)
.asGantt.AddGantt DateSerial(2002, 4, 1), DateSerial(2002, 4, 10), 0, "Series 1 - A"
.asGantt.AddGantt DateSerial(2002, 4, 5), DateSerial(2002, 4, 15), 1, "Series 1 - B"
' Make marks visible
.Marks.Visible = True
.Marks.ShadowSize = 0
.Marks.Gradient.Visible = True
End With
With TChart1.Series(1)
.asGantt.AddGantt DateSerial(2002, 5, 2), DateSerial(2002, 5,
, 2, "Series 2 - C"
.asGantt.AddGantt DateSerial(2002, 5, 9), DateSerial(2002, 5, 21), 3, "Series 2 - D"
' Make marks visible
.Marks.Visible = True
.Marks.ShadowSize = 0
.Marks.Gradient.Visible = True
End With
Re: missing label in chart
Posted: Tue Sep 28, 2010 9:45 am
by 10050769
Hello TonyVSUK,
It is not a bug; it is behaviour of TeeChart. Always you add more of one Series in your Chart, labels you are visualized, are labels of first Series that you have been added. If you want add labels of each series to the axes, you need use custom labels as is done in below code:
Code: Select all
Private Sub Form_Load()
TChart1.AddSeries scGantt
TChart1.AddSeries scGantt
TChart1.Aspect.View3D = False
' Disable automatic sorting by date
TChart1.Series(0).XValues.Order = loNone
TChart1.Series(1).XValues.Order = loNone
' Fill Gantt with sample date-time values:
With TChart1.Series(0)
.asGantt.AddGantt DateSerial(2002, 4, 1), DateSerial(2002, 4, 10), 0, "Series 1 - A"
.asGantt.AddGantt DateSerial(2002, 4, 5), DateSerial(2002, 4, 15), 1, "Series 1 - B"
' Make marks visible
.Marks.Visible = True
.Marks.ShadowSize = 0
.Marks.Gradient.Visible = True
End With
With TChart1.Series(1)
.asGantt.AddGantt DateSerial(2002, 5, 2), DateSerial(2002, 5, 8), 2, "Series 2 - C"
.asGantt.AddGantt DateSerial(2002, 5, 9), DateSerial(2002, 5, 21), 3, "Series 2 - D"
' Make marks visible
.Marks.Visible = True
.Marks.ShadowSize = 0
.Marks.Gradient.Visible = True
End With
TChart1.Axis.Left.Labels.Clear
For t = 0 To TChart1.SeriesCount - 1
For j = 0 To TChart1.Series(t).Count - 1
TChart1.Axis.Left.Labels.Add TChart1.Series(t).YValues.Value(j), TChart1.Series(t).PointLabel(j)
Next j
Next t
TChart1.Environment.InternalRepaint
End Sub
I hope will helps.
Thanks,
Re: missing label in chart
Posted: Tue Sep 28, 2010 10:10 am
by 9530487
It is not a bug; it is behaviour of TeeChart. Always you add more of one Series in your Chart, labels you are visualized, are labels of first Series that you have been added. If you want add labels of each series to the axes, you need use custom labels as is done in below code:
This cannot be right. Are you saying that I can add as many series to a chart as I want, but only ever get labels from the 1st series?
Every other series behaves properly, you add a series and the label shows up. Just Gantt charts only show the first series' labels. They should show all the other series labels as well, and if not, why not?
Re: missing label in chart
Posted: Tue Sep 28, 2010 2:30 pm
by 10050769
Hello TonyVSUK,
This cannot be right. Are you saying that I can add as many series to a chart as I want, but only ever get labels from the 1st series?
Every other series behaves properly, you add a series and the label shows up. Just Gantt charts only show the first series' labels. They should show all the other series labels as well, and if not, why not?
Sorry, I have checked it only with last version of TeeChart.Net and ActivetX 8 and in both cases using text labels. I have informed you that in next version of TeeChart Pro v2010 ActiveX this behaviour don’t appear and is working properly. At the moment, you have used custom labels.
On the other hand, I have added your requests in TeeChart .Net wish-list with number [
TF02015173]to be considered inclusion in next versions of TeeChart.Net.
I hope will helps.
Thanks,
Re: missing label in chart
Posted: Tue Sep 28, 2010 2:32 pm
by 9530487
Sorry, I don't understand. Do you mean the bug is fixed in TeeChart v2010?
Re: missing label in chart
Posted: Tue Sep 28, 2010 2:43 pm
by 10050769
Hello TonyVSUK,
It is fixed in last version of TeeChart VCL 2010 and for next version TeeChart Pro Activex 2010, but not in TeeChart .Net (TF02015173).
Thanks,
Re: missing label in chart
Posted: Tue Sep 28, 2010 2:59 pm
by 9530487
Thanks.