Hi,
I have to draw six lines, three using left axis and three using right axis. The problem is that the left and right axis both have seperate grid, which makes the chart look funny. Is there any way the left and right axis can share the same grid?
Thanks a lot!
David
How to share the same grid between left and right axis
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi David,
They would have the same grid if they shared the very same scale. This can be achieved doing something like this:
They would have the same grid if they shared the very same scale. This can be achieved doing something like this:
Code: Select all
Private Sub Form_Load()
For i = 0 To TChart1.SeriesCount - 1
TChart1.Series(i).FillSampleValues 10
Next
TChart1.Environment.InternalRepaint
End Sub
Private Sub TChart1_OnBeforeDrawAxes()
Dim Min, Max As Double
With TChart1.Axis
Max = .Left.Maximum
Min = .Left.Minimum
If Max < .Right.Maximum Then
Max = .Right.Maximum
End If
If Min > .Right.Minimum Then
Min = .Right.Minimum
End If
.Left.SetMinMax Min, Max
.Right.SetMinMax Min, Max
End With
End Sub
Best Regards,
Narcís Calvet / 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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi David,
Yes, it can work but this may not be the effect you are looking for. Another easy option would be hidding one of the axes grid lines:
Yes, it can work but this may not be the effect you are looking for. Another easy option would be hidding one of the axes grid lines:
Code: Select all
TChart1.Axis.Left.GridPen.Visible = False
Best Regards,
Narcís Calvet / 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 |