Giter VIP home page Giter VIP logo

jfxutils's People

Contributors

gforman44 avatar gillius avatar hwaite avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jfxutils's Issues

LineChart<String, Number> not supported.

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)

Zooming with mouse drag from right to left

Hi,

My application can zoom when primary mouse key is pressed, dragged right side of the screen and released and it draws a rectangle to show the area it'll zoom.

But whenever I try to do this from right to lleft, nothing happens.
What may be the cause?

Edit: Checked the demo for jfxutils, it has the same issue. How can I fix this?

Adding a label column next to chart

Hi,

I'm trying to get a column on the left side which changes accordingly to chart's zoom etc. I know there's already a grey background and white background changing with data but is there a way to get the coordinates so I can implement labels which will resize with them?

Currently my program works like lets say:
---- are the grey background part where chart does automatically

A,1
A,2
A,3
B,1-------------------
B,2------------------- 
B,3-------------------
C,1
C,2
C,3
C,4
C,5

but I want to show them as:

      1 
A     2
___   3
      1-------------------
B     2-------------------
___   3-------------------
      1
      2
C     3
      4
___   5

How can I see where the chart does this background painting and is there another easy way to do this that comes to your mind?

JfxUtils utilization, intercept zoom event.

Hello, I wondering myself, how it was possible to intercept the zoom utilisation (wheel mouse or by using the rectangle) because after the new layout, I need to update my labels' positions. So initially I put a listener on the yAxis upper bound, but it generates some display issues. If you have any idea?

Anyway thank you a lot for this great library.

Thomas

Utility method to reset zoom on double click

Requested by @gforman44 with some suggested code:

/** Add double-click for auto-ranging.  If user double-clicks the x-axis, only that axis will be reset.  Likewise for y-axis
 */
public static void addDoubleClickAutoRange(final ScatterChart<?, ?> sc) {
    sc.addEventHandler(MouseEvent.MOUSE_CLICKED, ev -> {
        if (ev.getClickCount() == 2) {
            resetRange(sc, ev);
            ev.consume();
        }
    });
}
/** Reset AutoRanging for one or both axes, depending on where user clicked.  
 * x-axis only?  y-axis only?  chart --> both. 
 */
public static void resetRange(final ScatterChart<?, ?> sc, MouseEvent ev) {
    XYChartInfo i = new XYChartInfo(sc);
    if (!i.getXAxisArea().contains(ev.getX(), ev.getY())) sc.getYAxis().setAutoRanging(true);
    if (!i.getYAxisArea().contains(ev.getX(), ev.getY())) sc.getXAxis().setAutoRanging(true);
}

I will add similar functionality but use XYChart type and anonymous classes instead of Lambdas since jfxutils supports Java 7. Thanks for the code suggestions @gforman44!

JavaFX Scene Builder 1.1 --- jfxutils integration

This may be a real newbie question, but...

I want to use Scene Builder to create the .fxml files.

The Charting.fxml sample file contains the line ...

<?import org.gillius.jfxutils.chart.StableTicksAxis?> 

and the lines ...

<xAxis>
      <StableTicksAxis animated="true" side="BOTTOM" />
</xAxis>
<yAxis>
       <StableTicksAxis animated="true" side="LEFT" />
</yAxis>

As a result, Scene Builder will not open the Charting.fxml file.

What can I do about this?

Y-Axis is not ordered correctly and receiving the error delta must be positive

Hi,

I've around 6 area objects which has around 30 points each and they're all connected. I'm using linechart and if someone chooses 3 areas starting from A1 to A3, chart should be responsible for 90 records.

Now the problem is, I've order for every object and they come to chart accordingly but for some reason 5 records of record A3 are shown at the bottom. So Y axis is like,

A1
A2
A3
A5
A6
A3

And when I try to restrict it to get a better view, lets say from A2 to A4, it gives the exception that delta must be positive

I believe problem maybe because of the number of records. If I try the same thing with lets say 10 records per area, it works pretty good. But when they're 30, I've this problem

Gesture events support

So far ChartPanManager and JFXChartUtil accept only MouseEvents. Any plans to support GestureEvents as well? I'd like to pan with two-finger drag and zoom with pinches.

X-Axis DateFormat displays incorrect value

I am using the example code taken from below url,

https://github.com/gillius/jfxutils/blob/master/jfxutils-examples/src/main/java/org/gillius/jfxutils/examples/Charting.java

@FXML
void addSample() {
       series.getData().add( new XYChart.Data<Number, Number>( System.currentTimeMillis() - startTime,
		                      valueSlider.getValue() ) );
}

It works like a charm and no issues . but if i change from the above snippet

System.currentTimeMillis() **-** startTime to System.currentTimeMillis() **+** startTime. The x-axis dates get all messed up and chart didnt plot correctly.

In addSample method i added a sysout,
//format is HH:mm:ss
System.out.println("X is : " + format.format(System.currentTimeMillis() + startTime) + " : " + "Y is : " + valueSlider.getValue());

and the displayed value is : X is : 23:11:39 : Y is : 65.96194503171247 and so on.. The Y value is displayed properly.

Selection

Is that possible to dynamically select points in a chart in order to edit or remove it ?

If not, do you know any other Java plot library that can handle this ? (using JavaFX preferably)

Thanks

ChartZoomManager is missing a MouseEvent.MOUSE_CLICKED handler

I extended the fxutils in my own application so that a double click would restore the original zooming (turn it all off).

To do this I needed a MOUSE_CLICKED handler for the ChartZoomManager for the rectangle.

Unfortunately the eventHandler is private so I could not merely subclass and add it in.

ChartZoomManager needs:

	handlerManager.addEventHandler( false, MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
		@Override
		public void handle( MouseEvent mouseEvent ) {
			//Don't check filter here, we're either already started, or not
			onMouseClick(mouseEvent);
		}
	} );

or the eventHandler needs to be made protected (or other options).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.