Axis labels on bottom axis jammed for horizontal bar

TeeChart for ActiveX, COM and ASP
Post Reply
ESRI
Newbie
Newbie
Posts: 60
Joined: Wed Mar 09, 2005 5:00 am

Axis labels on bottom axis jammed for horizontal bar

Post by ESRI » Wed Oct 05, 2005 12:22 am

If we use, for example, values 0,1,2,3,4,5,6 to build a horizontal bar, automatic labels for the bottom axis overlap for most sizes of the window. If we use 1e-5,2e-5,3e-5,4e-5,5e-5,6e-5,7e-5 it formats and places labels fine.

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 Oct 05, 2005 9:39 am

Hi Alex,

I'm not able to reproduce it here using the code below:

Code: Select all

    With TChart1.Series(0)
        For i = 0 To 6
            .Add i, "", clTeeColor
        Next
    End With
Does this code works for you? Please feel free to modify it so that we can reproduce the proble here.
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

ESRI
Newbie
Newbie
Posts: 60
Joined: Wed Mar 09, 2005 5:00 am

Post by ESRI » Wed Oct 05, 2005 7:02 pm

Narcís,
Here is a c# code which exports BMP with jammed labels.

using System;
using TeeChart;
namespace tee_test
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
ITChart pChart = new TChartClass();
pChart.ClearChart();
int idx = pChart.AddSeries(ESeriesClass.scHorizBar);
pChart.Aspect.View3D = false;
pChart.Legend.Visible = false;
pChart.Header.Visible = false;

ISeries pSeries = pChart.Series(idx);
pSeries.Marks.Visible = false;

for (int i = 0; i < 7; i++)
pSeries.Add(i, null, 0xffffff);

IBMPExport pBMP = pChart.Export.asBMP;
pBMP.Height = 250;
pBMP.Width = 600;
pBMP.SaveToFile("c:\\tee_testJam.bmp");
}
}
}

ESRI
Newbie
Newbie
Posts: 60
Joined: Wed Mar 09, 2005 5:00 am

Post by ESRI » Wed Oct 05, 2005 7:08 pm

After additional testing i see that line

pSeries.Marks.Visible = false;

makes the difference.
If commented there is no label jam!

ESRI
Newbie
Newbie
Posts: 60
Joined: Wed Mar 09, 2005 5:00 am

Post by ESRI » Mon Oct 17, 2005 10:40 pm

So the question is why

pSeries.Marks.Visible = false;

makes the label jam?

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 Oct 18, 2005 11:26 am

Hi Alex,

Yes, I've been able to reproduce that and added the issue (TV52011014) to our defect list to be fixed for future releases. I've found that another workaround is setting pChart.Axis.Bottom.Labels.Style = EAxisLabelStyle.talMark as shown here:

Code: Select all

		static void Main() 
		{
			ITChart pChart = new TChartClass(); 
			pChart.ClearChart(); 
			int idx = pChart.AddSeries(ESeriesClass.scHorizBar); 
			pChart.Aspect.View3D = false; 
			pChart.Legend.Visible = false; 
			pChart.Header.Visible = false; 

			ISeries pSeries = pChart.Series(idx); 
			pSeries.Marks.Visible = false; 

			for (int i = 0; i < 7; i++) 
				pSeries.Add(i, null, 0xffffff); 

			pChart.Axis.Bottom.Labels.Style = EAxisLabelStyle.talMark;

			IBMPExport pBMP = pChart.Export.asBMP; 
			pBMP.Height = 250; 
			pBMP.Width = 600; 
			pBMP.SaveToFile("c:\\tee_testJam.bmp"); 
		}
Another solution is increasing bottom axis increment:

Code: Select all

pChart.Axis.Bottom.Increment=0.4;
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

Post Reply