Labels not showing in Gantt charts

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Janne
Newbie
Newbie
Posts: 22
Joined: Wed Dec 31, 2008 12:00 am

Labels not showing in Gantt charts

Post by Janne » Mon Dec 19, 2011 5:06 pm

Hi everyone,
I'm trying to build a Gantt web chart (v3) with several series in it, and I've gotten the impression from some forums that missing labels might be a problem in this case. So, I've tried to avoid that by putting all but one series showing on the right axis, and then hide it, leaving only the left axis visible. That way I can still use the hotspot tool to display the other labels when mouse is hovering over the bars, but only see one series displayed on the left axis.
I thought that worked well for a while, but not so anymore, and I've had problems with this coming and going throughout the development project. I just tried the below, for example.

method GanttChart.wcGantt_GetAxisLabel(sender: System.Object; e: Steema.TeeChart.GetAxisLabelEventArgs);
begin
if e.LabelText.Length>=11 then
e.LabelText:=e.LabelText.Substring(0,11)+' ...';
/ else
e.LabelText:=e.LabelText+' ';/

I'm pretty sure you can see what that code's supposed to do. Only, it stopped working (all labels disappeared completely) when I added the part in between the slashes (which are not part of the code of course). Funny thing is that after I removed that part again, the chart still refuses to display the labels correctly. I have setup my explorer such that it erases surfing history automatically, so it's nothing from the cache. It simply seems like this particular use of this particular chart type is unstable.

Anyone seen problems of this sort? Any hints you can give me?
rgds, Janne

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Labels not showing in Gantt charts

Post by Sandra » Wed Dec 21, 2011 1:17 pm

Hello Janne,

I can not reproduce your problem using last version 3 of TeechartFor.Net and next simple code:

Code: Select all

 protected void Page_Load(object sender, EventArgs e)
    {
        InitializeChart();
    }
    Steema.TeeChart.Styles.Gantt gantt1;
    Steema.TeeChart.Tools.SeriesHotspot hotspot1;
    private void InitializeChart()
    {
        WebChart1.Chart.Aspect.View3D = false;
        hotspot1 = new Steema.TeeChart.Tools.SeriesHotspot(WebChart1.Chart);
        gantt1 = new Steema.TeeChart.Styles.Gantt(WebChart1.Chart);
        gantt1.FillSampleValues();
        WebChart1.Chart.Legend.Alignment = Steema.TeeChart.LegendAlignments.Top;
        WebChart1.Chart.Axes.Bottom.Labels.Angle = 90; 
    }
Can you tell us, if previous code works as you want? If it doesn't works as you like or it doesn't reproduce your problem, please send us a simple project, because we can reproduce exactly your problem here.

Thanks,
Best Regards,
Sandra Pazos / 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

Janne
Newbie
Newbie
Posts: 22
Joined: Wed Dec 31, 2008 12:00 am

Re: Labels not showing in Gantt charts

Post by Janne » Tue Jan 10, 2012 3:13 pm

HI Sandra,

Sorry to have been out of sight for a while - it's been christmas you know.
Anyway, this problem seems to have gone away all by itself, I've probably done something to kill it, but at this point I cannot say what that was. Should it re-surface, I'll send up a flare.

I have another issue on the board, however, the one about margins. I'll get back to you under that post.
cheers,
rgds, Janne

Post Reply