How call refreshTicksVertical from NumberAxis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
maryan
Posts: 7
Joined: Thu Dec 01, 2011 9:53 am
antibot: No, of course not.

How call refreshTicksVertical from NumberAxis

Post by maryan » Thu Dec 08, 2011 11:13 am

Hey,
I have question. How can I call method refreshTicksVertical from NumberAxis class.
I want to change tick labels dynnamicly after click button therfore I need this.

matinh
Posts: 483
Joined: Fri Aug 11, 2006 10:08 am
Location: Austria

Re: How call refreshTicksVertical from NumberAxis

Post by matinh » Thu Dec 15, 2011 9:07 am

Hi!
maryan wrote:Hey,
I have question. How can I call method refreshTicksVertical from NumberAxis class.
I want to change tick labels dynnamicly after click button therfore I need this.
There shouldn't be any need to call it manually. When updating the axis fireChangeEvent() should be called internally which should notify all registered listeners. Did you try it?

- martin

mkrauskopf
Posts: 31
Joined: Thu May 27, 2010 4:23 pm
antibot: No, of course not.

Re: How call refreshTicksVertical from NumberAxis

Post by mkrauskopf » Thu Dec 15, 2011 9:23 am

But what if you override refreshTicksVertical to do some special logic which you want to change when a user clicks some button. So upon that button click you want to say "Hey plot, everything is the same, just redraw the the axis (and thus call my overridden refreshTicksVertical which will behave differently now)". There does not seems to be other way then forcing redraw of the whole plot. Or is it?

matinh
Posts: 483
Joined: Fri Aug 11, 2006 10:08 am
Location: Austria

Re: How call refreshTicksVertical from NumberAxis

Post by matinh » Thu Dec 15, 2011 9:31 am

Hm... I never was in need for doing anything like this (mostly using JFreeChart in Webapps). You could just call refreshTicks() which is public but that would only recalculate the ticks and not redraw the axis. There is a public Axis.draw() which you could try to call, but I'm not sure if this does exactly what you wan.

- martin

Locked