Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSGraph TickLabels Font Size 1

Status
Not open for further replies.

georgehoaghea

Programmer
Dec 5, 2003
5
CA
Hi
I want to use MSGraph(9.0) to create charts. Trying to control TickLabels.Font.Size with the code below it does not work, but TickLabels.Font.ColorIndex works. Any idea why?

mychart=thisform.Oleboundcontrol1
...
for i = 1 to mychart.Axes.Count
mychart.Axes(i).TickLabels.Font.Size = 10
mychart.Axes(i).TickLabels.Font.ColorIndex = 3
endfor

I have the same problem for Legend.Font.Size
Thanks in advance.
 
Thanks Dave but no change using OBJECT reference .

I find this strange because when I use TickLabels.Font.ColorIndex, it changes font's color, but using TickLabels.Font.Size, font's size does not change. Same problem for Legend.Font.Size.
What it can be?
 
I got them all to work.
I don't know how much versions matter, but here are my stats:
MSGraph 2000
OleClass MSGraph.Chart.8
VFP7 SP1
Win2k

Anyway, here's what I did.
I have a form named dave16, with a chart dropped on it named olecontrol1. All of the below examples changed the desired controls:
Code:
dave16.olecontrol1.axes(1).TickLabels.Font.Size = 8
dave16.olecontrol1.axes(2).TickLabels.Font.Size = 8
dave16.olecontrol1.axes(1).TickLabels.Font.Size = 12
dave16.olecontrol1.axes(2).TickLabels.Font.Size = 12

dave16.olecontrol1.axes(1).TickLabels.Font.Color = ;
   Rgb(255,0,0)
dave16.olecontrol1.axes(2).TickLabels.Font.Color = ;
   Rgb(0,0,255)

dave16.olecontrol1.legend.Font.Size = 10
dave16.olecontrol1.legend.Font.Size = 15
dave16.olecontrol1.legend.Font.Size = 8

dave16.olecontrol1.legend.Font.color = Rgb(0,255,0)
dave16.olecontrol1.legend.Font.color = Rgb(255,0,0)

mycontrol = dave16.olecontrol1
mycontrol.legend.Font.color = Rgb(0,255,255)
mycontrol.axes(1).TickLabels.Font.Color = Rgb(0,0,255)
mycontrol.axes(2).TickLabels.Font.Color = Rgb(255,255,0)

for i = 1 to mycontrol.Axes.Count
   mycontrol.Axes(i).TickLabels.Font.Size = 10
   mycontrol.Axes(i).TickLabels.Font.ColorIndex = 3
endfor
for i = 1 to mycontrol.Axes.Count
   mycontrol.Axes(i).TickLabels.Font.Size = 8
   mycontrol.Axes(i).TickLabels.Font.ColorIndex = 4
endfor

Maybe you're just not referencing the control properly? Not sure.
In the meantime though, you may want to check out this excellent example by one of our gurus, Mike Lewis:


-Dave S.-
[cheers]
Even more Fox stuff at:
 
Thanks Dave,
Giving me a bunch of examples to change control and seeing me code working to you, I tried again.
My olecontrol1 is little on the form.
I have just placed mychart.Width = 650 and mychart.Height = 430 BEFORE changing TickLabels size, not AFTER(the way that I used before) and it works great!

Thanks you!
George
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top