bar series missing labels

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Apr 02, 2009 1:24 pm

Hi UserLS,

Thanks for the information.

I'm still unable reproducing it using code below and resizing the chart. Does it work fine at your end? Could you please modify it so that we can reprodcue the problem here?

Code: Select all

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

		private void InitializeChart()
		{
			this.Width = 800;
			this.Height = 600;

			tChart1.Dock = DockStyle.Fill;
			tChart1.Legend.Visible = false;

			Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);

			Random y = new Random();

			bar1.Add(y.Next(), "13 char label");
			bar1.Add(y.Next(), "13 char label");
			bar1.Add(y.Next(), "13 char label");
			bar1.Add(y.Next(), "13 char label");
			bar1.Add(y.Next(), "13 char label");
			bar1.Add(y.Next(), "13 char label");
			bar1.Add(y.Next(), "13 char label");
			bar1.Add(y.Next(), "13 char label"); 
		}
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

UserLS
Advanced
Posts: 247
Joined: Wed May 23, 2007 12:00 am

Post by UserLS » Thu Apr 02, 2009 3:09 pm

Ok, I was wrong. It does work as is, but if I add labels to the axis (not by adding points with labels to series) - than it does not.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Apr 03, 2009 7:35 am

Hi UserLS,

Of course, using custom labels plots as many labels as you have added to the axis regardless chart dimensions. For further custom labels functionality please read this thread. It's quite long but most options available were discussed there, most interesting results being at last pages.
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

UserLS
Advanced
Posts: 247
Joined: Wed May 23, 2007 12:00 am

Post by UserLS » Fri Apr 10, 2009 4:00 am

So, in other words, custom labels are useless by design, since I have no time to re-implement the logic, you supposedly have for the other labels, for custom labels? What the point to have them, if they might break my graph and there is no good way to control them?

Anyway, back to the labels, which are supposed to work. If you run the following code with different counts (I tried 40 and 390), please, explain to me, why the chart is showing no more than 10 (in some cases only 4) labels, even when maximized to the full screen?

Code: Select all

        private void AddBarWithLabels(int count)
        {
            tChart1.Clear();
            var bar = new Bar(tChart1.Chart)
                          {
                              Color = Color.Yellow,
                              Gradient =
                                  {
                                      Direction = LinearGradientMode.Horizontal,
                                      Visible = true,
                                      StartColor = Color.Red,
                                      EndColor = Color.Green,
                                      MiddleColor = Color.DeepPink,
                                  }
                          };
            bar.Marks.Visible = false;
            tChart1.Axes.Bottom.Labels.Angle = 90;
            tChart1.Axes.Bottom.Labels.Separation = 1;
            tChart1.Axes.Bottom.Increment = 0;
            tChart1.Axes.Bottom.Automatic = true;
            for (var i = 0; i <= count; i++)
            {
                bar.Add(i, i*i/300 - 1, DateTime.Now.AddMonths(i).ToString());
            }
            tChart1.Legend.Visible = false;
        }
There was a reason, I added those labels and rotated them, so as many, as can fit on the screen, would show up (again, Win32 did not have any problems here).

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Apr 14, 2009 8:00 am

Hi UserLS,
So, in other words, custom labels are useless by design, since I have no time to re-implement the logic, you supposedly have for the other labels, for custom labels? What the point to have them, if they might break my graph and there is no good way to control them?
Custom labels work as designed. For using logic you request you should use standard labels.
Anyway, back to the labels, which are supposed to work. If you run the following code with different counts (I tried 40 and 390), please, explain to me, why the chart is showing no more than 10 (in some cases only 4) labels, even when maximized to the full screen?
This is a known issue (TF02013544) already listed in the defect list. On this thread I posted a workaround using custom labels.
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

UserLS
Advanced
Posts: 247
Joined: Wed May 23, 2007 12:00 am

Post by UserLS » Tue Apr 14, 2009 10:10 pm

On this thread I posted a workaround using custom labels.
But you've just told me that custom labels are broken by design - I cannot use them, because if I do - I'll have labels overlapping each other (if I use count=1000).

BTW. What is the purpose of the custom labels? When I would like to use them (since, by design, they are not supposed to work, as one would expect)? There are cases where I'd like to use them (to skip some of the points on the chart), but... they are not going to behave well. And they do not work at all, when axis is logarithmic.

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 Apr 15, 2009 7:08 am

Hi UserLS,

I didn't say custom labels are broken. I said this is they behavior by design. If you want to have TeeChart automatic labelling logic use standard labels. If you want to have absolute control over which labels are displayed in your chart use custom labels.
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

UserLS
Advanced
Posts: 247
Joined: Wed May 23, 2007 12:00 am

Post by UserLS » Wed Apr 15, 2009 3:06 pm

All I want is the behavior of Win32 version: I have added all the labels and TChart shows them as they fit. I do not have time to implement rather complicated logic (which you guys obviously cannot get right even knowing the product much better than me) in order to be able to use your custom labels (yes, from my point of view as a customer they are either absolutely useless or simply badly broken) and the regular labels do not work right. I do not understand, why you cannot reuse the logic from Win32 which worked fine, but you had your reasons. Well, at this point I need it to work. And my usual question - when I can hope for it to be fixed?
Also, I did provide a list of issues, we really need to be fixed. Where I can go to at least see, what is your plan for the next releases (so I'll have an idea, which ones you are going to attempt to fix and which ones we need either create a work around for or remove a feature from our product)? Watching this forum is great, but it does not tell me, when a particular problem is scheduled to be worked on. I have this list of tracking numbers, but it is no good, if I cannot ask the system about the status on it.

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 Apr 29, 2009 1:07 pm

Hello UserLS,

We have been investigating TF02014049 now. When you described the issue at the previous page you said:
The Win32 version was doing it right years ago!
We tested this here using v7 and v8 versions and none of them work fine either. Could you please let us know in which Win32 version it worked fine? Code used:

Code: Select all

uses Series;

procedure TForm1.FormCreate(Sender: TObject);
var Series : TLineSeries;
  I: Integer;
begin
   Series:=TLineSeries.Create(Self);
   Chart1.AddSeries(Series);

   Chart1.Legend.Visible:=false;
   for i := 0 to 320 - 1 do
   begin
     Series.Add(Random);
   end;

   Chart1.Axes.Bottom.Logarithmic:=true;
   Chart1.Axes.Bottom.LogarithmicBase:=10;
   Chart1.Axes.Bottom.Automatic:=false;
   Chart1.Axes.Bottom.Increment:=3;
end;
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

UserLS
Advanced
Posts: 247
Joined: Wed May 23, 2007 12:00 am

Post by UserLS » Fri May 01, 2009 2:27 pm

As I already have mentioned earlier, because of the custom changes to the source code, we could not easily upgrade to the new versions (we did it once and it was a huge pain!) So we stayed with TChart 5 for years. Our custom changes were not in the area in question (it was mostly to change the look and behavior of the editor and a few of memory leaks and AV errors, mostly around series and functions, so our program would not blow up). As to logarithmic axis - I did not have to mess up with increment. I just had it automatic, add all the points I have - all the labels will be displayed correctly (no overlap problem and it shows as many as it will be able to fit). Same is true, when I have regular axis with labels rotated at 90 degrees - the chart will display as many as it will fit and no overlapping.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon May 04, 2009 2:57 pm

Hi UserLS,

Thanks for the information.

We did some tests using TeeChart v5.03 VCL and this code:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject); begin
  TeeShowAboutBox;
end;

procedure TForm1.CreateChart;
begin
  Chart:=TChart.Create(Self);
  Chart.Align:=alClient;
  Chart.Parent:=Panel1;
end;

procedure TForm1.FormCreate(Sender: TObject); begin
   CreateChart;
   InitializeChart;
end;

procedure TForm1.InitializeChart;
var Series : TLineSeries;
  I: Integer;
begin
   Series:=TLineSeries.Create(Self);
   Chart.AddSeries(Series);

   Chart.Legend.Visible:=false;
   for i := 0 to 320 - 1 do
   begin
     Series.Add(Random);
   end;

   Chart.BottomAxis.Logarithmic:=true;
   Chart.BottomAxis.LogarithmicBase:=10;
   Chart.BottomAxis.Automatic:=false;
   Chart.BottomAxis.Increment:=3;
end;
Which produces this chart:

Image

As you can see, the same problem occurs.

Can you please run the above code on the version of TeeChart VCL you have and let us know which exact version is it? Do you get the same behavior?

This is important, as you may have made custom changes to the source for the above to work. If we can ascertain that at one stage it did work, it's going to be easier for us to fix.

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

UserLS
Advanced
Posts: 247
Joined: Wed May 23, 2007 12:00 am

Re: bar series missing labels

Post by UserLS » Mon Nov 02, 2009 2:49 pm

My settings on the bottom axis are set as following:
Logarithmic := true;
LogarithmicBase := 10;
Automatic := true;
Increment := 0;

I have 360 points and the labels are displayed just fine (I can resize my chart and still have reasonable behavior!) And I did not have to code for it to behave!
Attachments
Large graph.jpg
Large graph.jpg (64.22 KiB) Viewed 13532 times
Samll graph.jpg
Samll graph.jpg (38.91 KiB) Viewed 13529 times

UserLS
Advanced
Posts: 247
Joined: Wed May 23, 2007 12:00 am

Re: bar series missing labels

Post by UserLS » Mon Nov 02, 2009 3:22 pm

I finally could upgrade to the latest version and it seems to take care of most (if not all) the problems with labels!
Good job, guys!

Post Reply