-
November 13th, 2002, 03:21 PM
#1
MSChart - Grid Lines
Anyone know how to get rid of the grid lines of a simple 2Dline chart?
Below is a simple example I am trying to use but need to get rid of the grid lines. The example works just fine for what I need.
'
SImply add a MSCHART to a form, add a Command button and paste the code.
Code:
Private Sub Command1_Click()
Dim arrPriceQuantity(1 To 5, 1 To 2)
Dim i As Integer
' create some values
For i = 1 To 5
arrPriceQuantity(i, 1) = "Label " & i ' Horizontal Labels
arrPriceQuantity(i, 2) = RandomNumber(50, -10) ' Data
Next i
MSChart1.chartType = VtChChartType2dLine
MSChart1.ChartData = arrPriceQuantity
With MSChart1.Plot.Axis(VtChAxisIdY).ValueScale
.Auto = False
.Minimum = -10
.Maximum = 50
End With
End Sub
'
Public Function RandomNumber(T As Long, B As Long)
Randomize ' Initialize random-number generator.
RandomNumber = Int((T * Rnd) + B) ' Generate random value
Debug.Print RandomNumber
End Function
-
November 13th, 2002, 04:08 PM
#2
Right click on the control in design time and select properties. Select the axis grid tab. For the x-axis, y-axis and second y-axis set the major gridlines style to null.
-
November 13th, 2002, 06:01 PM
#3
JVBD02,
Thanks that was it.
Do you know of a way to set this at runtime?
-
November 13th, 2002, 06:18 PM
#4
Having had a quick look at the properties, I see none that would allow for what you want at runtime. However, there got to be some way of doing it - anyone else...?
-
November 15th, 2002, 01:48 PM
#5
Don't need it right now but was interested for setting up a sample program that would do everything probmatically instead of having to write instructions or comments in the sample.
'
Thanks again
John
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|