Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LineChart<String, Number> not supported. #11

Open
ghost opened this issue May 28, 2016 · 4 comments
Open

LineChart<String, Number> not supported. #11

ghost opened this issue May 28, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented May 28, 2016

Using a LineChart with a String in either x or y axis will cause the ChartZoomManager to break.

Exception in thread "JavaFX Application Thread" java.lang.ClassCastException: javafx.scene.chart.CategoryAxis cannot be cast to javafx.scene.chart.ValueAxis
at org.gillius.jfxutils.chart.ChartZoomManager.(ChartZoomManager.java:137)

@gillius
Copy link
Owner

gillius commented May 29, 2016

Right now the library is meant to work with numerical axes only, so I assume value axis. I'm not sure it makes sense to zoom on category axes, but perhaps it could make sense to allow zooming constrained to the one ValueAxis if only X or Y is a value axis. That would be quite useful for charts showing states over time (like on/off, etc.) Is that what you are looking for?

@gforman44
Copy link
Contributor

Jason,
I just added a right-click context menu to my chart.  Unfortunately, when I drag the chart around with the right button, it ends the drag by opening the context menu.  Oops.  I think  have a solution, but I haven't tested it.
org.gillius.jfxutils.chart.ChartPanManager line 82 should        mouseEvent.consume()   IF in fact we were doing a drag.   Unconsumed, the system pops up the menu.   release() could return a boolean so we know whether to consume the event.
I know--- back burner.  Me too.
  George

On Saturday, May 28, 2016 8:31 PM, Jason Winnebeck <notifications@github.com> wrote:

Right now the library is meant to work with numerical axes only, so I assume value axis. I'm not sure it makes sense to zoom on category axes, but perhaps it could make sense to allow zooming constrained to the one ValueAxis if only X or Y is a value axis. That would be quite useful for charts showing states over time (like on/off, etc.) Is that what you are looking for?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@gillius
Copy link
Owner

gillius commented Oct 19, 2016

Are you using the default mouse event filter that only handles primary button drags and ignores right clicks? But it sounds like you want it to pan with the right button if you drag but open menu if you don't. If I recall, jfxutils doesn't consume the events in most places.

@gforman44
Copy link
Contributor

Hi, Jason,

 If I recall, jfxutils doesn't consume the events in most places.
Righto.  I'm using a mouse event filter that uses left-drag for zooming and right-drag for panning.  I just now added a pop-up menu, and it springs to life after a pan.  Oops.   My workaround is to use middle-drag for panning instead.  Good enough for me for now, but I'm thinking that the right solution is to consume the right-drag release events, and don't consume the right-nodrag release events.  Then the JavaFx can fire up the pop-up menu if not consumed.
  George

Just thought I'd mention one other thing for the eventual re-write ;)---  the mouse event filter's logic is a bit backward-- it consumes the event to tell JfxUtil NOT to act.  /** A JfxUtil filter that accepts only a simple, single-click MIDDLE drag without modifiers. consume() tells JfxUtils.jar to reject, oddly! */ public static final EventHandler SIMPLE_MIDDLE = ev -> { if (!JfxUtil.isDrag(ev, MouseButton.MIDDLE, 1)) ev.consume(); };

On Tuesday, October 18, 2016 7:09 PM, Jason Winnebeck <notifications@github.com> wrote:

Are you using the default mouse event filter that only handles primary button drags and ignores right clicks? But it sounds like you want it to pan with the right button if you drag but open menu if you don't. If I recall, jfxutils doesn't consume the events in most places.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants