Is there a way to change the way gridlines are drawing?

TeeChart for ActiveX, COM and ASP
Post Reply
GLSWG
Newbie
Newbie
Posts: 39
Joined: Fri Jan 09, 2004 5:00 am

Is there a way to change the way gridlines are drawing?

Post by GLSWG » Mon Mar 08, 2004 11:50 am

Currently on our charts the horizontal gridlines are above the vertical gridlines but I actually want to have it the otherway around. I want the vertical gridline to be above the horizontal gridline which gives this sense of deepness. Is that possible? Any ideas?

Thank you in advance.
Igor.

Pep
Site Admin
Site Admin
Posts: 3278
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Mar 08, 2004 8:41 pm

Hi Igor,

one way to do this could be to create a custom bottom axis, use it for the Series and make invisible the one by default. In this manner it will draw the Vertical grid lines in front of the Horizontal.

GLSWG
Newbie
Newbie
Posts: 39
Joined: Fri Jan 09, 2004 5:00 am

Post by GLSWG » Tue Mar 09, 2004 11:47 am

Hi Josep,

Thank you for reply. That works great except of one little issue. Now it is displayed two 0.00 positions on Left Axis - one for default Bottom Axis and one for custom I added. Even if I'm hiding default Bottom Axis still it seems saving a place for it. And custom axis is displaying below this "reserved" line. Can I permanently disable or remove default Bottom Axis and use only custom as one and only for horizontal axis? Again, thank you for your prompt help.

Igor.

Pep
Site Admin
Site Admin
Posts: 3278
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Mar 09, 2004 1:37 pm

Hi Igor,

does this happens assigning the custom axis as the Horizontal for the Series ?
tChart1.Series(0).HorizontalAxisCustom = tChart1.Axis.AddCustom(True)

It works fine using the following code :

Code: Select all

Private Sub Form_Load()
With TChart1
    .Aspect.View3D = False
    .AddSeries scLine
    .Series(0).FillSampleValues (10)
    .Series(0).HorizontalAxisCustom = .Axis.AddCustom(True)
    .Panel.MarginBottom = 10
    With .Axis.Left.GridPen
        .Style = psSolid
        .Color = vbBlue
        .Width = 3
    End With
    With .Axis.Custom(0).GridPen
        .Style = psSolid
        .Color = vbRed
        .Width = 3
    End With
End With
End Sub

GLSWG
Newbie
Newbie
Posts: 39
Joined: Fri Jan 09, 2004 5:00 am

Post by GLSWG » Tue Mar 09, 2004 4:44 pm

Josep,

Here's the code I'm using VC++ 6.0

Code: Select all

CAxes cAxes= m_ctlTChart.GetAxis(); 
		cAxes.GetBottom().SetVisible(FALSE); 
		
		long nAxesNumber = cAxes.AddCustom(TRUE); 
		CAxis cBottomAxis = cAxes.GetCustom(nAxesNumber);
		cBottomAxis.SetStartPosition(0);
		cBottomAxis.SetEndPosition(100);
		m_ctlTChart.Series(nSeriesIndex).SetHorizontalAxisCustom(nAxesNumber);  
		
I believe it has the same semantics as the code in VB that you posted in the sense that custom axis is associated with the serie via SetHorizontalAxisCustom. Still showing two "0.00".

Igor.

GLSWG
Newbie
Newbie
Posts: 39
Joined: Fri Jan 09, 2004 5:00 am

Post by GLSWG » Tue Mar 09, 2004 4:54 pm

to continue...Actually I have noticed that it shows ALL values on Left Axis in double instances when using custom horizontal axis. And horizontal gridlines also two time more, that it would be using default bottom axis.

....
0.01
0.01
0.00
0.00

All this is happend on Bar 2D serie.
What am I doing wrong? PLease, advice.

Pep
Site Admin
Site Admin
Posts: 3278
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Mar 12, 2004 11:14 am

Hi Igor,

using the following code (and the TeeChart Pro v6.04) works as expected here, could you please test it ?

Code: Select all

	m_chart.GetAspect().SetView3D(false);
	m_chart.AddSeries(scBar);
	m_chart.Series(0).FillSampleValues(10);
	m_chart.Series(0).SetHorizontalAxisCustom(m_chart.GetAxis().AddCustom(true));
	m_chart.GetPanel().SetMarginBottom(10);
	m_chart.GetAxis().GetLeft().GetGridPen().SetStyle(psSolid);
	m_chart.GetAxis().GetLeft().GetGridPen().SetColor(RGB(200,0,0));
	m_chart.GetAxis().GetLeft().GetGridPen().SetWidth(3);
	m_chart.GetAxis().GetCustom(0).GetGridPen().SetStyle(psSolid);
	m_chart.GetAxis().GetCustom(0).GetGridPen().SetColor(RGB(10,10,10));
	m_chart.GetAxis().GetCustom(0).GetGridPen().SetWidth(3);
If you still having problem please, post the code you're using so we can reproduce the problem "as is" here, or send me an example to the steema.public.attachments newsgroup.

Post Reply