axis labels font changes?

192 views
Skip to first unread message

Eric Hsu

unread,
Jun 22, 2013, 6:10:19 PM6/22/13
to jsxg...@googlegroups.com
What is the recommended way to change the font and size of the axis labels (i.e. the numbers next to the ticks)?

thanks, Eric 

michael

unread,
Jun 24, 2013, 2:25:30 AM6/24/13
to jsxg...@googlegroups.com
Hi Eric,

the size can be changed directly with the attribute fontSize, but the font can only be changed with the cssClass attribute and a corresponding css definition:


Please note that this only works if the display of the tick labels is set to 'html'.


Michael

Eric Hsu

unread,
Jun 24, 2013, 11:17:20 AM6/24/13
to jsxg...@googlegroups.com
Thank you, that's very helpful. 

I currently have the y-axis labels offset so they appear on the left. But the numbers still are growing to the right, so for instance, 100 is now printing over the y-axis.  I tried to use CSS to text-align: right, but that didn't seem to do it.

Is there some clever way to have the axis number grow to the left? 

thanks, Eric

michael

unread,
Jun 24, 2013, 1:19:01 PM6/24/13
to jsxg...@googlegroups.com


On Monday, 24 June 2013 17:17:20 UTC+2, Eric Hsu wrote:
Is there some clever way to have the axis number grow to the left?
Of course ;) Use the anchorX attribute and set it to 'right':


I know, it's a bit confusing, this mixture of CSS and JavaScript object attributes. But unfortunately it is necessary due to the different rendering methods we use, so JSXGraph can run on as many browsers as possible.


Michael

Eric Hsu

unread,
Jun 24, 2013, 9:56:27 PM6/24/13
to jsxg...@googlegroups.com
Thanks! It is a little confusing, but it works!  And the JSFiddle examples really really help. 

Thanks, Eric
Reply all
Reply to author
Forward
0 new messages