controlling and labelling major/minor ticks

142 views
Skip to first unread message

alyssa

unread,
Apr 3, 2011, 5:10:16 PM4/3/11
to JSXGraph
Hi again,

I'm manually creating an x axis that spans only from 0 to 1. Right now
it's automatically putting a major tick at .5 and labelling just that
one. I'd like it to place a major tick and label it every .2. Is this
possible?

I know I can enter these ticks manually, but I will be controlling the
axis using sliders later on, so if it's possible to control more
automatically by distance that would be helpful.

I tried using ticksDistance: .2 but it stopped putting ticks in after
2 ticks.

Thanks in advance!
Alyssa

michael

unread,
Apr 4, 2011, 3:40:32 AM4/4/11
to JSXGraph
Hi Alyssa,

you should try the attribute minTicksDistance. Its value intepreted as
an amount of pixels determines how close two major ticks may get
before one of them disappears.


michael

alyssa

unread,
Apr 5, 2011, 10:04:48 AM4/5/11
to JSXGraph
Still not working.

xaxis = brd.create('axis', [[0, 0],[1, 0]], {ticksDistance:.2,
minTicksDistance:0});

gives me an x-axis from 0 to 1 with only 2 ticks...any idea what's
going on?

~Alyssa

michael

unread,
Apr 6, 2011, 5:36:26 AM4/6/11
to JSXGraph
This is a bug. It is fixed now and this will work as expected after
the upcoming release:

xaxis = board.create('axis', [[0, 0], [1, 0]], {
ticks: {
ticksDistance: .2,
insertTicks: false
}
});

Please note that the attributes for the ticks on the axis will be
bundled in the ticks attribute. "insertTicks" set to false prevents
the automatic tick adjustments.


michael

alyssa

unread,
Apr 6, 2011, 9:35:00 PM4/6/11
to JSXGraph
thanks again!

alyssa

unread,
Apr 6, 2011, 9:37:01 PM4/6/11
to JSXGraph
when is the upcoming release due around?

michael

unread,
Apr 7, 2011, 9:47:39 AM4/7/11
to JSXGraph
I can't say exactly but there should be another release candidate
available within the next few days.

alyssa

unread,
Apr 7, 2011, 9:04:36 PM4/7/11
to JSXGraph
awesome! thanks a lot.
Reply all
Reply to author
Forward
0 new messages