displaying grid with javascript

sanchisgr shared this question 9 years ago
Answered

I would like to have a check box to display or not the grid. I have the following javascript attached to my check box.


var e=ggbApplet.getValue("e");

if (e==true) {ggbApplet.setGridVisible(true)} else {ggbApplet.setGridVisible(false)}


It works fine, but it shows/hides the grid on both graphics windows. How can I make it only affect the first graphics window?


Thanks.

Gabriela Sanchis

Comments (6)

photo
1

I was looking for a GeoGebraScript command, possibly SetGridVisible(true/false,1/2).


The only thing I could find was a reference in the wiki to your JavaScript command. IMHO, this is a worthwhile task for a new feature unless it already exists.


Tony

photo
1

Hi

a work around in this file


https://ggbm.at/552011


Daniel

photo
1

Well - I came up with one solution which isn't bad. I made the grid for the second window white.

photo
1

@sanchisgr, 8) idea, but I can think of reasons to have grids at different times in different windows.


@daniel, would it be nicer if this could be done only using GGScript? But nice job, you used a white grid on Graphic2.


Both well done.


Tony

photo
1

Hi Tony

@daniel, would it be nicer if this could be done only using GGScript? But nice job, you used a white grid on Graphic2.

Tony

Impossible to do in GGBscript because no informations about grid and axes for the sheet, only in Javascript

Daniel

photo
1

I was implying, I would like there to be a GGS feature to allow this with the ability to chose the window. The feature is not available with fully JavaScript either.


Tony

© 2021 International GeoGebra Institute