missing label in chart
missing label in chart
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
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
- Attachments
-
- missing label.JPG (28.75 KiB) Viewed 17066 times
Re: missing label in chart
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.
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.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: missing label in chart
Hello daniela,
I make a simple example using custom labels, and I think that will help you to solve your problem:
Please, check code works fine in your application.
Thanks,
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]);
}
}
}
Thanks,
Best Regards,
Sandra Pazos / 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 |
Re: missing label in chart
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.
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.
- Attachments
-
- missing label test.JPG (16 KiB) Viewed 16990 times
Re: missing label in chart
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:
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();
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: missing label in chart
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
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
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
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:
I hope will helps.
Thanks,
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
Thanks,
Best Regards,
Sandra Pazos / 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 |
Re: missing label in chart
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?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:
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
Hello TonyVSUK,
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,
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?
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.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?
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,
Best Regards,
Sandra Pazos / 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 |
Re: missing label in chart
Sorry, I don't understand. Do you mean the bug is fixed in TeeChart v2010?
Re: missing label in chart
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,
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,
Best Regards,
Sandra Pazos / 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 |
Re: missing label in chart
Thanks.