Git Product home page Git Product logo

fair-acc / chart-fx Goto Github PK

View Code? Open in Web Editor NEW
474.0 474.0 88.0 24.16 MB

A scientific charting library focused on performance optimised real-time data visualisation at 25 Hz update rates for data sets with a few 10 thousand up to 5 million data points.

License: GNU Lesser General Public License v3.0

Java 98.81% CSS 0.70% Shell 0.09% SCSS 0.40%
chart-fx charting-libraries data-visualisation hacktoberfest java javafx large-dataset scientific-visualization

chart-fx's People

Contributors

ajackson2681 avatar braeun avatar dedeibel avatar dependabot[bot] avatar domenicquirl avatar edkennard avatar ennerf avatar hansolo avatar ichaus-we avatar marsblessed avatar mccartney avatar miho avatar milo-gsi avatar mkkl1 avatar ralphsteinhagen avatar raven2cz avatar restyled-commits avatar restyled-io[bot] avatar rsuna avatar theboegl avatar tonimarc1990 avatar u386 avatar uosis avatar wirew0rm 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chart-fx's Issues

Custom legend is not visible - FIXED

Hi!
Thanks for providing this great alternative for charts with JavaFX, the struggle has been real!

Ok so the issue is rather simple: when setting the legend of a XYChart, this legend is not visible unless you cycle the Chart.legendVisible property. The issue shows up for any legend implementation, even DefaultLegend.

I'm depending on the version 8.1.1.

I used SimpleChartSample to highlight the issue, here is the code:

package com.example.chartfx;

import de.gsi.chart.XYChart;
import de.gsi.chart.axes.spi.DefaultNumericAxis;
import de.gsi.chart.legend.spi.DefaultLegend;
import de.gsi.dataset.spi.DoubleDataSet;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

public class SimpleChartSample extends Application {
    private static final int N_SAMPLES = 100;

    @Override
    public void start(final Stage primaryStage) {
        final StackPane root = new StackPane();

        final XYChart chart = new XYChart(new DefaultNumericAxis(), new DefaultNumericAxis());
        root.getChildren().add(chart);

        // The new legend is not visible
        chart.setLegend(new DefaultLegend());
        // Uncomment the following 2 lines to enable current workaround:
//        chart.setLegendVisible(false);
//        chart.setLegendVisible(true);


        final DoubleDataSet dataSet1 = new DoubleDataSet("data set #1");
        final DoubleDataSet dataSet2 = new DoubleDataSet("data set #2");
        // lineChartPlot.getDatasets().add(dataSet1); // for single data set
        chart.getDatasets().addAll(dataSet1, dataSet2); // two data sets

        final double[] xValues = new double[N_SAMPLES];
        final double[] yValues1 = new double[N_SAMPLES];
        final double[] yValues2 = new double[N_SAMPLES];
        for (int n = 0; n < N_SAMPLES; n++) {
            xValues[n] = n;
            yValues1[n] = Math.cos(Math.toRadians(10.0 * n));
            yValues2[n] = Math.sin(Math.toRadians(10.0 * n));
        }
        dataSet1.set(xValues, yValues1);
        dataSet2.set(xValues, yValues2);

        final Scene scene = new Scene(root, 800, 600);
        primaryStage.setTitle(this.getClass().getSimpleName());
        primaryStage.setScene(scene);
        primaryStage.setOnCloseRequest(evt -> System.exit(0));
        primaryStage.show();
    }
    public static void main(final String[] args) {
        Application.launch(args);
    }
}

Dev version lock() does not work properly - FIXED

I tried to move the live charts to the dev snapshot, but I ran into an issue that immediately caused the app to halt.

After a far-too-long time debugging, I eventually traced it down to lock()->writeLockGuard(()->{}) causing a deadlock when points get added from a non-FX thread.

If I override the DoubleErrorDataSet::add(x,y) method with a Platform.runLater(()->{super.add(x,y);}) everything works as expected.

line start (from NaN) rendered incorrectly

@RalphSteinhagen asked for a video in #26. A video of Scope with the latest dev snapshot is here: https://youtu.be/SXEf-2NyUlw

While recording it I noticed two more minor issues:

  • in 01:15 I'm starting to send commands, which changes the positionCmd (dashed) from NaN to the current feedback value. I'd expect the line to start at the first valid point, but for some reason it starts from the bottom of the screen. (The bottom is cut-off, so it's not visible, but it did come in from the bottom edge)

image

  • In 03:12 I'm trying to pan, but it's panning much faster than it should. I've seen this occasionally in the past, but I haven't found a reliable way to reproduce it yet.

The static chart has about 2 million datapoints total (3x 642.875). Kudos btw. for making that work so well... the previous version sometimes crashes when loading logs like this :)

javafx.graphics does not export com.sun.javafx.scene.layout to unnamed module

I get a runtime exception when running any example.

I use java11 and this commit:

8f5afda

Here is the exception:

/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:56233,suspend=y,server=n -

......

slf4j-api/1.7.25/slf4j-api-1.7.25.jar:/Users/dani/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/191.7479.19/IntelliJ IDEA.app/Contents/lib/idea_rt.jar" -p /Users/dani/.m2/repository/org/openjfx/javafx-base/11/javafx-base-11-mac.jar:/Users/dani/.m2/repository/org/openjfx/javafx-graphics/12.0.1/javafx-graphics-12.0.1-mac.jar de.gsi.chart.samples.RunChartSamples
Connected to the target VM, address: '127.0.0.1:56233', transport: 'socket'
Exception in Application constructor
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
	at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: Unable to construct Application instance: class de.gsi.chart.samples.RunChartSamples
	at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:890)
	at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java:802)
	at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
	at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
	at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run$$$capture(InvokeLaterDispatcher.java:96)
	at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java)
Caused by: java.lang.IllegalAccessError: superclass access check failed: class com.sun.javafx.scene.control.ControlHelper (in unnamed module @0x17776a8) cannot access class com.sun.javafx.scene.layout.RegionHelper (in module javafx.graphics) because module javafx.graphics does not export com.sun.javafx.scene.layout to unnamed module @0x17776a8
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:802)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:700)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:623)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	at javafx.scene.control.Control.<clinit>(Control.java:86)
	at de.gsi.chart.samples.RunChartSamples.<init>(RunChartSamples.java:55)
	... 11 more
Exception running application de.gsi.chart.samples.RunChartSamples

Dev version Y axis still flickers - FIXED

The Y axis flicker issue still exists in the dev version.

Fixing the y axis results in a very smooth video: https://youtu.be/vuzG4XRBWAA

DefaultNumericAxis yAxis = new DefaultNumericAxis("Values", "");
yAxis.setAutoGrowRanging(false);
yAxis.setAutoRanging(false);
yAxis.setUpperBound(5);
yAxis.setLowerBound(0);

Enabling an auto-range still flickers: https://youtu.be/ZWjRCRhqp2I
(I did a comparison earlier. The left window is the older JChart2D version)

DefaultNumericAxis yAxis = new DefaultNumericAxis("Values", "");
yAxis.setForceZeroInRange(true);
yAxis.setAutoGrowRanging(true);
yAxis.setAutoRanging(true);

TimeAxis range exclude day

I wanna show for example dates in range 13.01.2020 to 16.01.2020, but exclude 14 and 15 days of january. How I can to do it ?

Negative Points are not registered by the DataPointTooltip Plugin

There appears to be a small typo in the DataPointTooltip Plugin between lines 155 and 157. Currently the code reads:

final DataPoint nextPoint = nextIndex == -1 || nextIndex == prevIndex ? null
                : new DataPoint(getChart(), dataSet.get(DataSet.DIM_X, nextIndex),
                        dataSet.get(DataSet.DIM_X, nextIndex), getDataLabelSafe(dataSet, nextIndex));

This causes DataPoints to show up at the wrong location for some negative values and correct points not to be registered. Using the lines below seems to fix the issue:

final DataPoint nextPoint = nextIndex == -1 || nextIndex == prevIndex ? null
                : new DataPoint(getChart(), dataSet.get(DataSet.DIM_X, nextIndex),
                        dataSet.get(DataSet.DIM_Y, nextIndex), getDataLabelSafe(dataSet, nextIndex));

basically the nextPoint was sent to (x, x) instead of (x, y). This issue only comes up for some ranges of values, so it is hard to spot.

Zoomer plugin regression: UnsupportedOperationException on clear

Hi again.

There was a regression introduced in 11.1.1, when underlying deque for zoomstacks in Zoomer was changed from ArrayDeque to ObservableDeque.
Here it tries to clear zoomstacks, but ObservableDeque does not implement clear method, so it throws an exception (for me it happened when I set zoom origin filter, since when you try to zoom to origin, it clears zoomstacks).

[Regression] GridPane crashes (@1kHz update rates) - FIXED

I tried to do a few long-running tests with live-charts at 1KHz and noticed that the latest dev version keeps crashing after 1-2 hours. I did some 24h+ tests last week, so this must be a recent regression.

I've tried a few different versions and it looks like this was introduced in minor: made drawing of grid on top/bottom CSS more easily configurable (4d8ebc3)

The full error is below. The application still runs, but the stage with the chart needs to be closed.

Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
	at javafx.graphics/javafx.scene.layout.GridPane.growToMultiSpanPreferredWidths(Unknown Source)
	at javafx.graphics/javafx.scene.layout.GridPane.adjustColumnWidths(Unknown Source)
	at javafx.graphics/javafx.scene.layout.GridPane.computeWidthsToFit(Unknown Source)
	at javafx.graphics/javafx.scene.layout.GridPane.computeMinHeight(Unknown Source)
	at javafx.graphics/javafx.scene.Parent.minHeight(Unknown Source)
	at javafx.graphics/javafx.scene.layout.Region.minHeight(Unknown Source)
	at javafx.graphics/javafx.scene.layout.Region.boundedNodeSizeWithBias(Unknown Source)
	at javafx.graphics/javafx.scene.layout.Region.layoutInArea(Unknown Source)
	at javafx.graphics/javafx.scene.layout.Region.layoutInArea(Unknown Source)
	at javafx.graphics/javafx.scene.layout.Region.layoutInArea(Unknown Source)
	at javafx.graphics/javafx.scene.layout.StackPane.layoutChildren(Unknown Source)
	at javafx.graphics/javafx.scene.Parent.layout(Unknown Source)
	at javafx.graphics/javafx.scene.Parent.layout(Unknown Source)
	at javafx.graphics/javafx.scene.Parent.layout(Unknown Source)
	at javafx.graphics/javafx.scene.Parent.layout(Unknown Source)
	at de.gsi.chart.ui.HiddenSidesPane.resizeRelocate(HiddenSidesPane.java:252)
	at javafx.graphics/javafx.scene.layout.AnchorPane.layoutChildren(Unknown Source)
	at javafx.graphics/javafx.scene.Parent.layout(Unknown Source)
	at javafx.graphics/javafx.scene.Scene.doLayoutPass(Unknown Source)
	at javafx.graphics/javafx.scene.Scene$ScenePulseListener.pulse(Unknown Source)
	at javafx.graphics/com.sun.javafx.tk.Toolkit.lambda$runPulse$2(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at javafx.graphics/com.sun.javafx.tk.Toolkit.runPulse(Unknown Source)
	at javafx.graphics/com.sun.javafx.tk.Toolkit.firePulse(Unknown Source)
	at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
	at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
	at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(Unknown Source)
	at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(Unknown Source)
	at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
	at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

Jumping x axis

I keep hitting cases where the x-axis becomes very difficult to read because the axis labels keep "jumping", i.e., every half a second the labels change from [1,2,3,4,5, etc.] to [1.5,2.5,3.5,4.5,etc.].

Here is a video of what I mean: https://youtu.be/RNTAVZD_PDs

I've tried playing around with the tick units, but they don't seem to make a difference. Is there anything else I can do?

11.1.3 tick label gap rendering change - SOLVED

I just tried to update to the latest version and found that the x-axis labels are now being rendered outside the lower bounds. It seems that the behavior of the tick label gap has changed from being applied horizontally to being applied all around.

Was this a conscious choice? If so, is there a way to get the old behavior back?

11.1.2 (tick label gap 30)
image

11.1.3 (tick label gap 30)
image

11.1.3 (tick label gap 0)
image

Time axis does not handle negative values - FIXED

The time axis (e.g. xAxis.setTimeAxis(true)) does not handle negative values. I've so far run into this in two cases:

  • When a plot starts at time zero and a user tries to zoom out. That causes the bounds to go negative and throw an error.
Exception in thread "JavaFX Application Thread" java.time.DateTimeException: Invalid value for NanoOfSecond (valid values 0 - 999999999): -100000000
  at java.base/java.time.temporal.ValueRange.checkValidValue(Unknown Source)
  at java.base/java.time.temporal.ChronoField.checkValidValue(Unknown Source)
  at java.base/java.time.LocalDateTime.ofEpochSecond(Unknown Source)
  at de.gsi.chart.axes.spi.format.DefaultTimeFormatter.getTimeString(DefaultTimeFormatter.java:126)
  ...
  • When showing a fixed window size where the time starts at zero, i.e., the left bound for a 10 second window would begin at -10 seconds.

3D Line Chart

I'm currently trying to plot data in a 3D line chart similar to MATLAB's plot3 command. I haven't used the 3D interface yet, but if I understand correctly there is currently no actual 3D grid/view, right?

What do you think would be the best way to implement something like this?

MATLAB sample code

x = 0:0.001:4*pi;
y = sin(x);
z = cos(x);

plot3(x,y,z)
grid on;
xlabel('x');
ylabel('y');
zlabel('z');
title('3D Line Chart');

view 1
image

view 2
3d-line2

What's the best way to change the tooltip label css style?

Sorry that I'm also not familiar with JavaFX, now I am using the Tooltip plugin, and I found that the style control is in de.gsi.chart.chart.css resource, there is a .chart-datapoint-tooltip-label, I would like to change the alignment from center to left. What's the suggested way to override that from coding?

How to use project with javafx:jlink ?

I use this project in another project as dependency and run with VM options:

--module-path "C:\Users\Toxa\Desktop\javafx-sdk-13.0.1\lib"
--add-modules=javafx.swing,javafx.graphics,javafx.fxml,javafx.media,javafx.web,javafx.controls
--add-reads javafx.graphics=ALL-UNNAMED
--add-opens javafx.controls/com.sun.javafx.charts=ALL-UNNAMED
--add-opens javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED
--add-opens javafx.controls/com.sun.javafx.scene.control.inputmap=ALL-UNNAMED
--add-opens javafx.graphics/com.sun.javafx.scene.traversal=ALL-UNNAMED
--add-opens javafx.graphics/com.sun.javafx.iio=ALL-UNNAMED
--add-opens javafx.graphics/com.sun.javafx.iio.common=ALL-UNNAMED
--add-exports javafx.graphics/com.sun.javafx.css=ALL-UNNAMED
--add-opens javafx.base/com.sun.javafx.runtime=ALL-UNNAMED

it's work fine. But if i try to run with javafx:run -f pom.xml get an error Unable to make public static com.sun.javafx.css.StyleManager com.sun.javafx.css.StyleManager.getInstance() accessible: module javafx.graphics does not "exports com.sun.javafx.css" to unnamed module @275b12e

What I should to do and is it real to get what I want ?
Is exists another decision for build executable jar and than exe ?
Can't find solution 5 days already. Hope some one will help.

Error when "mvn exec:java" at dataset

Could not find artifact de.gsi.dataset:chartfx-dataset:jar:11.1.0-SNAPSHOT

I've tried many JDK versions, along with various sequences of compiling. The error sticks with the above error message about dataset.

MacOS Catalina 10.15.1
OpenJDK 11.0.2
Intellij IDEA 2019.2
Maven 3.6.1

The dependencies are massive

Our JavaFX application needs to be distributed to clients as a standalone version, i.e., including a runtime and all dependencies. Unfortunately, adding ChartFX turns a 45MB distributable into almost 90MB. This means that ChartFX alone currently is the same size as an entire JRE with OpenJFX and a decently complex application.

Using the maven-shade-plugin on chartfx-chart creates a massive uber-jar with 77.4MB:

[INFO] Including org.openjfx:javafx-controls:jar:12.0.1 in the shaded jar.
[INFO] Including org.openjfx:javafx-controls:jar:win:12.0.1 in the shaded jar.
[INFO] Including org.openjfx:javafx-graphics:jar:12.0.1 in the shaded jar.
[INFO] Including org.openjfx:javafx-graphics:jar:win:12.0.1 in the shaded jar.
[INFO] Including org.openjfx:javafx-swing:jar:12.0.1 in the shaded jar.
[INFO] Including org.openjfx:javafx-swing:jar:win:12.0.1 in the shaded jar.
[INFO] Including org.openjfx:javafx-fxml:jar:12.0.1 in the shaded jar.
[INFO] Including org.openjfx:javafx-fxml:jar:win:12.0.1 in the shaded jar.
[INFO] Including de.gsi.dataset:chartfx-dataset:jar:11.0.1-SNAPSHOT in the shaded jar.
[INFO] Including it.unimi.dsi:fastutil:jar:8.2.3 in the shaded jar.
[INFO] Including de.gsi.math:chartfx-math:jar:11.0.1-SNAPSHOT in the shaded jar.
[INFO] Including org.apache.commons:commons-math3:jar:3.6.1 in the shaded jar.
[INFO] Including org.jfxtras:jfxtras-labs:jar:8.0-r5 in the shaded jar.
[INFO] Including org.jfxtras:jfxtras-agenda:jar:8.0-r5 in the shaded jar.
[INFO] Including org.jfxtras:jfxtras-controls:jar:8.0-r5 in the shaded jar.
[INFO] Including org.jfxtras:jfxtras-common:jar:8.0-r5 in the shaded jar.
[INFO] Including org.jfxtras:jfxtras-fxml:jar:8.0-r5 in the shaded jar.
[INFO] Including org.controlsfx:controlsfx:jar:11.0.0 in the shaded jar.
[INFO] Including org.openjfx:javafx-base:jar:11 in the shaded jar.
[INFO] Including org.openjfx:javafx-base:jar:win:11 in the shaded jar.
[INFO] Including org.openjfx:javafx-media:jar:11 in the shaded jar.
[INFO] Including org.openjfx:javafx-media:jar:win:11 in the shaded jar.
[INFO] Including org.openjfx:javafx-web:jar:11 in the shaded jar.
[INFO] Including org.openjfx:javafx-web:jar:win:11 in the shaded jar.
[INFO] Including de.codecentric.centerdevice:javafxsvg:jar:1.3.0 in the shaded jar.
[INFO] Including org.apache.xmlgraphics:batik-transcoder:jar:1.8 in the shaded jar.
[INFO] Including org.apache.xmlgraphics:batik-anim:jar:1.8 in the shaded jar.
[INFO] Including org.apache.xmlgraphics:batik-css:jar:1.8 in the shaded jar.
[INFO] Including org.apache.xmlgraphics:batik-ext:jar:1.8 in the shaded jar.
[INFO] Including org.apache.xmlgraphics:batik-parser:jar:1.8 in the shaded jar.
[INFO] Including org.apache.xmlgraphics:batik-svg-dom:jar:1.8 in the shaded jar.
[INFO] Including org.apache.xmlgraphics:batik-awt-util:jar:1.8 in the shaded jar.
[INFO] Including org.apache.xmlgraphics:batik-bridge:jar:1.8 in the shaded jar.
[INFO] Including org.apache.xmlgraphics:batik-script:jar:1.8 in the shaded jar.
[INFO] Including xalan:xalan:jar:2.7.0 in the shaded jar.
[INFO] Including org.apache.xmlgraphics:batik-dom:jar:1.8 in the shaded jar.
[INFO] Including org.apache.xmlgraphics:batik-gvt:jar:1.8 in the shaded jar.
[INFO] Including org.apache.xmlgraphics:batik-svggen:jar:1.8 in the shaded jar.
[INFO] Including org.apache.xmlgraphics:batik-util:jar:1.8 in the shaded jar.
[INFO] Including org.apache.xmlgraphics:batik-xml:jar:1.8 in the shaded jar.
[INFO] Including xml-apis:xml-apis:jar:1.3.04 in the shaded jar.
[INFO] Including xml-apis:xml-apis-ext:jar:1.3.04 in the shaded jar.
[INFO] Including org.apache.xmlgraphics:xmlgraphics-commons:jar:2.1 in the shaded jar.
[INFO] Including commons-io:commons-io:jar:1.3.1 in the shaded jar.
[INFO] Including commons-logging:commons-logging:jar:1.0.4 in the shaded jar.
[INFO] Including com.ibm.icu:icu4j:jar:63.1 in the shaded jar.
[INFO] Including org.slf4j:slf4j-api:jar:1.7.25 in the shaded jar.

Dependency Sizes

Selectively including individual artifact groups yields the following (bold highlighting indicates that they'd be easy to get rid of):

  • org.openjfx:javafx-web: 23.3MB
  • it.unimi.dsi:fastutil: 19MB
  • com.ibm.icu:*: 13MB
  • org.openjfx:*: 11MB (without web)
  • org.apache.xmlgraphics:*: 3.6MB
  • xalan:*: 3.3MB
  • org.jfxtras:*: 3MB
  • org.apache.commons:*: 2.8MB
  • de.gsi.*: 1.7 MB
  • org.controlsfx:*: 1.5MB
  • xml-apis:*: 1MB
  • org.slf4j:*: 0.7MB
  • de.codecentric.centerdevice:*: 0.6MB

Total 84.2MB (each result includes the project jar, so each size is off by roughly 0.6MB)

Suggestions

  • javafx-web seems to be a transient compile dependency from ControlsFX that can probably be manually excluded by users. (23MB)

  • it.unimi.dsi:fastutil is only used for the DoubleArrayList in DoubleDataSet. The used functionality can be implemented in a few lines of code (e.g. DGrowArray), so it's probably worth duplicating it to get rid of ~20 (!!!) MB.

  • de.codecentric.centerdevice:javafxsvg has a huge dependency tree (all of org.apache.xmlgraphics, xml-apis, xalan, commons-io, commons-logging), but it's only used for loading svg images in the ChartIconFactory. Using downscaled PNG images would save another ~10 MB. Besides the size, adding >20 dependencies is also a big issue when using ProGuard for obfuscation/shrinking. There could be an extension point in case some users feel really strongly about using svg.

  • com.ibm.icu is only used for the DecimalFormat in NumberFormatterImpl. I'm pretty sure that this could be replaced with Java's built-in DecimalFormat. (13MB).

  • I did not find any use of org.jfxtras anywhere. This may be an unused dependency? Another 3MB

Not counting the OpenJFX packages, this would turn ChartFX into a much more reasonable 2-3MB dependency.

Edit: It'd also be nice if org.slf4j could be turned into an optional dependency, similar to how it's done in other fx libraries (e.g. AfterBurner.fx::Injector). SLF4J is small, but it produces potentially unwanted output to the console, such as warnings if there is no configuration.

Missing lines when data point is outside of x axis range - SOLVED

When I have two values A and B as subsequent values in a data set, and the x value of one of them (e.g. of A) is just outside the x axis range, the line to the other data point (e.g. B) is sometimes (but not always) not drawn. This is especially noticeable when the x axis range is shifted: Lines at the range edges suddenly vanish or appear.
This does not always happen when one data point is outside of the visible range: There seems to be a threshold distance to the x axis range until/from which on the lines are drawn.

I would expect the lines from an invisible point to a visible point to be drawn always (as long as both data points are contained in the data set). [Alternativelly: Never drawing them would be consistent, but IMO not desirable.]

Please see attached example program.
DEMO_MissingValue.txt
The buttons on the bottom can be used to shift the x axis range. By shifting multiple times, we can see that points move out of the visible range with their lines still drawn, then the lines suddenly vanish. On the other side, there appears to be a gap in the graph until a line to a not yet visible data point suddenly appears.
4 Shifts to the right, line on the left still visible, line one the right not yet visible:
2020-03-19_DemoMissingValues_4Shifts
5 Shifts to the right, line on the left vanished, line one the right appeared:
2020-03-19_DemoMissingValues_5Shifts
By shifting back and forth, it becomes obvious that the data points are still contained by their data set, they/their lines are simply not drawn.

I could reproduce this behaviour with LimitedIndexedTreeDataSet, FifoDoubleErrorDataSet, and CircularDoubleErrorDataSet. I did not check any other datasets.

As suggested by @wirew0rm via chat, I turned off data reduction via
renderer.setPointReduction(false). This did not change the outcome.

Is DataSet thread safe?

I just tried this project, looks very good.

I want to dynamic add/remove points from dataset, and it works, but I was wondering if the dataset add method or remove method thread-safe, which I can call it from another thread (currently I'm using Akka actor)?

chart-fx x.1.0 roadmap

Roadmap of changes for the next release of chartfx (x.1.0):

General:

  • Replace all occurences of system.out with slf4j
  • Use simple default slf4j Configuration for tests and samples. Documentation for library users.
  • Travis: allow CI (without deploy) for Pull Requests, check Tag for correct version format, make sure every tag is built

DataSet:

  • move from simple lock to (optimistic) ReadWriteLock
  • remove undefVlaue from DataSet
  • AxisDescription Interface
    DataSet
    • Move getXValues/getYValues to dataSet2D
  • TreeDataSet: fix indexing bugs for labels and styles
  • Serializer

Chart:

  • Hide/Show plugin-toolbar without rescaling the chart
  • MountainRangeRenderer: Fix zoom issues
  • Renderer: Allow charts to be displayed transposed
  • Improve DataViewer [low priority]

Math:

  • IIR/FIR filters: constructors should be static methods
  • math library -> moved to #44
    • requirements: xi²-fit, matrix, svd, complex, gauss
    • candidates: apache-commons-math, smile, netlibs(ATLAS via JNI)

chart-fx x.2.0 roadmap

Roadmap of changes for the next release of chartfx (x.2.0):

Leftovers from #38 ... to be extended (contributions are welcome)

General:

  • modularisation, see also #160
  • change licensing model from Apache 2.0 to LGPL v3.0
  • remove @Deprecated marked API
  • reduce code dupplication and refactoring of utility methods
  • improve JUnit 5 test coverage
  • Curated docs (beginner -> advanced)
  • remove verbose logging esp. in tests

DataSet:

  • Make DataSet multi dimension capable, DataSet2D and DataSet3D on same level below DataSet
  • remove DataSet::getDataCount(int) interface method (as above)
  • Sorted Flag in DataSet?
  • SerializedDataSet (zeroCopy, in-place deserialisation) [low priority]

Chart:

  • move from usage SVG (Batik-) to fonts (Ikonli-based)
  • Add dimension to axis interface instead of using the position in axis list and its side (needed e.g. to display color axis below chart)

Math:

Axes Do Not Resize on Maximize -- FIXED

When resizing via the maximize window button, the axes do not expand to fill the newly grown chart. Manual click-and-drag resizing works as expected.
Debugging shows that axes grow to expected maximized sizes when window is un-maximized. Furthermore, this can be replicated in the ErrorDataSetRendererSample demo.

Initial chart sizes:
Initial size of charts

Charts after maximize (vertical axis did not grow):
Charts after maximize (did not grow vertically)

Impossible to hide axis label

This issue new with the version 11.1.2, wasn't there in 8.1.1.

The real issue is that there is no direct control over the visibility of the axis label.
From looking at the code, for instance AbstractAxis.computePrefWidth(double), it seems that the intention is that if the text in AbstractAxisParameter.axisLabel is either null or empty, then the label would be hidden. However, after a call to AbstractAxisParameter.updateAxisLabelAndUnit(), the label can never be empty, thus can never be hidden as there no visible flag for it.

After running some debug, it seems that the only reason the issue didn't show up for me when using the version 8.1.1, is simply because AbstractAxisParameter.updateAxisLabelAndUnit() would never be called while when switching to 11.1.2, it appears to be called when initially rendering the chart.

The goal for me being to hide the axis labels, a workaround is to override the method updateAxisLabelAndUnit() and pretty much skip the update.

Applications don't close due to user threads in executor service - FIXED

Applications that have the parallell rendering implementation enabled don't automatically stop on Platform::exit because the executor service creates user threads rather than daemon threads.

I wasn't sure where to put it, but it could be fixed pretty easily with

private static final ThreadFactory DAEMON_THREAD_FACTORY = new ThreadFactory() {
        private final ThreadFactory defaultFactory = Executors.defaultThreadFactory();
        @Override
        public Thread newThread(Runnable r) {
            Thread thread = defaultFactory.newThread(r);
            thread.setDaemon(true);
            return thread;
        }
    };

private static final ExecutorService EXECUTOR_SERVICE = Executors.newFixedThreadPool(2 * MAX_THREADS, DAEMON_THREAD_FACTORY);

I found two Executors, one in EventThreadHelper and one in CachedDataPoints.

Panner doesn't recover with right-click - FIXED

It's not a big issue, but just something that I've run into from time to time. I always use the Zoomer/Panner plugins together and typically use them like this:

Zoom-first

  • zoom in somewhere
  • pan around
  • right-click -> returns back to original view

However, when the panner is used first (maybe to better see something on an edge) the default view can't be recovered via right-click, and the chart needs to be reset via the menu button.

Pan-first

  • pan somewhere
  • zoom in
  • pan around
  • right click -> returns to the state after the first panning step
  • (be confused for a second)
  • press the menu button -> returns back to original view

How to add dataset to different renderer?

So, I want to have multiple dataset, some I want to plot with stair case, some I want to plot like matplotlib stem lines.

In the example, XYChart is created, and there is a default renderer there. So I have to create a new stair case renderer:

  val renderer = {
    val renderer = new HistoryDataSetRenderer()
    renderer.setPolyLineStyle(LineStyle.STAIR_CASE)
    chart.getRenderers.add(renderer)
    renderer
  }

now, If I call chart.getDatasets().add(dataset), it will be rendered twice, if I call renderer.getDatasets().add(dataset) it only plot once. So what's the difference? If I want to render different dataset in the same chart differently, should I always call renderer.getDatasets().add()?

setTimeAxis doesn't seem to work -- NOT AN ISSUE

I'm building a chart for btc analysis, but I can't seem to set my x axis to a time axis. Here's my code

val xAxis1 = new DefaultNumericAxis()
xAxis1.setTimeAxis(true)
val yAxis1 = new DefaultNumericAxis("y axis", "$")
yAxis1.setAnimated(false)

And this is what my chart looks like, my x axis still displays numbers instead of dates
image
What am I doing wrong? I'm using v 8.0.2

Modify error in dataset doesn't work -- NOT AN ISSUE

So I use ErrorDataSet and ErrorDataSetRenderer, where I utilize the x positive error to draw a line into the future.

Now, every second, I lock the dataset and update the x pos error, but the render doesn't show the new future line.

If I change the y value instead of x pos error, the point will change, which means, for x and y, modify data then emit an invalidate event, it works, but if I just change the error value, it won't work.

Linux: mouse wheel scroll-in not working

OS
Ubuntu 18.10

Version
ChartFX 11.1.0
OpenJDK 13.0.1
OpenJFX 13.0.1

Issue
Scrolling in by using the mouse-wheel does not seem to work. Scrolling out produces the same behavior as on Windows and OSX.

I tried to debug this, but I didn't see anything obvious. The generated events look sane (deltaY is +40/-40), and the events aren't being filtered, i.e., setting the zoom-in/out and scroll filters to always return true does not fix it.

Change Color of DefaultNumericAxis TickMark labels - SOLVED

I'm trying to accomplish a dark theme style for my graph, and the current barrier to that is the fact that the TickMarks in the graph are black, like so:

Capture

I've tried looking at the de.gsi.chart.axes.spi.TickMark class, but it does not have a styleclass added. Is there any way I can style these tickmark labels?

Basic Questions

Background

First of all, thanks for writing a JavaFX charting library. I've been using JChart2D for what seems like forever, and I can't wait to finally get rid of the last remaining Swing parts.

I've been working on an application that visualizes streaming sensor/measurement data in real-time. One of the features is a way for non-programmers to create custom charts via XML files where they can specify equations as well as things like default ranges, colors, styles, and so on. For example

<chart title="GYROSCOPE" min_range="-3" max_range="+3" range_policy="expanding">
    <trace label="gyroX" units="rad/s" color="red" style="solid" value="fbk.gyroX" />
    <trace label="gyroY" units="rad/s" color="green" style="solid" value="fbk.gyroY" />
    <trace label="gyroZ" units="rad/s" color="blue" style="solid" value="fbk.gyroZ" />
</chart>

image

and

<chart title="LATENCY" min_range="0" max_range="0.5" range_policy="expanding">
    <trace label="Round Trip Time (RTT)" units="ms" color="black" style="points" value="(fbk.pcRxTime - fbk.pcTxTime)*1E3" />
    <trace label="Hardware Response Time" units="ms" color="blue" style="points" value="(fbk.hwTxTime - fbk.hwRxTime)*1E3" />
    <trace label="Transmit Time dt" units="ms" color="green" style="points" value="isNaN(prevFbk.pcTxTime) ? 0 : (fbk.pcTxTime - prevFbk.pcTxTime)*1E3" />
</chart>

image

Unfortunately, I keep running into various basic issues when trying to port the charts over to chart-fx.

Questions / Problems

  • We typically want to show the last N measurements, or the last (up to N) measurements within some time period. It'd be nice to have a LimitedCircularDoubleDataSet. It sounds very much like #8, so I'd second that as a feature request. Once I'm more familiar with this library I may be able to contribute something.

  • How can I dynamically set colors for individual datasets? The only reference I've found was in RollingBufferLegacyExample via setting the chart style for .default-color{index}.chart-series-line{...}. Unfortunately, doing that doesn't seem to have any effect.

  • Similarly, how can I selectively change the style of individual datasets? e.g. render one dataset with only markers (e.g. MATLAB's ., o, x), and another dataset as a solid/dashed/dotted line without markers (e.g. MATLAB's -, --, :). DataSet::getDataStyleMap::put seems to apply only to individual points

  • How can I render a dashed line? I found some usages of DashPatternStyle in the GridRenderer, but found nothing about using it for individual datasets.

  • What JDK/JFX version were you using for the performance comparisons in your paper? In particular, I'd be interested to know whether the numbers are before or after the Marlin renderer changes.

Thanks!

Edit: cleaned up the questions a bit

Add default implementation for DataSet2D::get

DataSet has methods get(int dim, int index) and getIndex(int dim, double value).

DataSet2D provides a default implementation for getIndex, but not for the get method. It'd be nice if that were added as well.

I tested #58 and haven't checked the develop branch.

Questions about implement a new DataSet

I would like to implement a DataSet that will efficiently support adding/removing data. The requirement comes from that I want to dynamically plotting some event. These events are not coming in regular time, they can be 1 event per second, or 1000 events per second. For this reason, the buffer size of data points will keep changing, based on time, say, I want to always plot the last 10 minutes data.

Now I checked the default DoubleDataSet implementation, and it uses array: https://github.com/GSI-CS-CO/chart-fx/blob/master/chartfx-dataset/src/main/java/de/gsi/dataset/spi/DoubleDataSet.java#L27

During adding/removing, a new array will be created and old data will be copied there: https://github.com/GSI-CS-CO/chart-fx/blob/master/chartfx-dataset/src/main/java/de/gsi/dataset/spi/DoubleDataSet.java#L242

So, I would like to use some ring-buffer for the implementation to make it more efficient.

Now the question comes, because I saw the interface exposes data as array: https://github.com/GSI-CS-CO/chart-fx/blob/master/chartfx-dataset/src/main/java/de/gsi/dataset/spi/DoubleDataSet.java#L125

That means, somewhere else in the framework, perhaps the renderer, they work with array, which means, even if I use ring buffer for the internal implementation of the dataset, the framework still requires making array out of the ring buffer, which turns it again not efficient.

Any ideas or suggestions?

Error in attempting to run sample applications

Attempted to compile and run the sample application using maven. Current maven version 3.6.1, current java version 12.0.2. Followed following instructions from the github page

git clone
cd chart-fx
mvn compile
mvn exec:java -Dproject.mainClass=de.gsi.chart.samples.RunChartSamples

when I ran, the program compiled correctly, however, on attempting to run the following error was received -

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for chartfx 11.0.1-SNAPSHOT:
[INFO]
[INFO] chartfx ............................................ FAILURE [ 0.959 s]
[INFO] dataset ............................................ SKIPPED
[INFO] math ............................................... SKIPPED
[INFO] chartfx-chart ...................................... SKIPPED
[INFO] chartfx-samples .................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.637 s
[INFO] Finished at: 2019-08-08T22:37:59-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3.2:java (default-cli) on project chartfx: The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin:1.3.2:java are missing or invalid -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3.2:java (default-cli) on project chartfx: The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin:1.3.2:java are missing or invalid
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:567)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginParameterException: The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin:1.3.2:java are missing or invalid
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields (DefaultMavenPluginManager.java:644)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:597)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:124)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:567)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginParameterException

I am fairly new to maven so this being an error on my end is within the realm of possibility, however, I am submitting this here in the case it isn't.

Can't run samples from command line windows

Hi,

So, I downloaded the charts and tried to run them by doing
mvn compile install
but that unfortunately failed with the following error

2 errors
1 warning
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for chartfx 11.1.0-SNAPSHOT:
[INFO]
[INFO] chartfx ............................................ SUCCESS [  2.575 s]
[INFO] dataset ............................................ SUCCESS [ 23.456 s]
[INFO] math ............................................... SUCCESS [ 23.436 s]
[INFO] chartfx-chart ...................................... FAILURE [ 41.912 s]
[INFO] acc ................................................ SKIPPED
[INFO] chartfx-samples .................................... SKIPPED
[INFO] report ............................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:31 min
[INFO] Finished at: 2020-04-20T17:08:11+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.0.1:jar (attach-javadocs) on project chartfx-chart: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1 - D:\chart-fx\chartfx-chart\src\main\java\de\gsi\chart\ui\HiddenSidesPane.java:34: error: heading used out of sequence: <H3>, compared to implicit preceding heading: <H1>
[ERROR]  * <h3>Screenshot</h3> The following screenshots shows the right side node hovering over a table after it was made
[ERROR]    ^
[ERROR] D:\chart-fx\chartfx-chart\src\main\java\de\gsi\chart\plugins\ParameterMeasurements.java:24: warning: empty <p> tag
[ERROR]  * <p>
[ERROR]    ^
[ERROR] D:\chart-fx\chartfx-chart\src\main\java\de\gsi\chart\ui\SidesPane.java:25: error: heading used out of sequence: <H3>, compared to implicit preceding heading: <H1>
[ERROR]  * <h3>Screenshot</h3> The following screenshots shows the right side node hovering over a table after it was made
[ERROR]    ^
[ERROR]
[ERROR] Command line was: "C:\Program Files\Java\jdk-13.0.2\bin\javadoc.exe" @options @packages
[ERROR]
[ERROR] Refer to the generated Javadoc files in 'D:\chart-fx\chartfx-chart\target\apidocs' dir.
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :chartfx-chart

D:\chart-fx>

I am using java 13.0.2 with maven 3.6.3.

I also tried that with versions 14.0.1 and 11.0.6 with no luck.

Am I missing anything? I am new to maven. So any help would be appreciated!

Thank you!

Specified TickUnit has no effect on time axis (DefaultNumericAxis)

Hi,

I noticed that the TickUnit does not seem to have any effect on a time x axis (DefaultNumericAxis). I attached an example.

When setting tick unit to 30 (seconds), I would expect to see tick marks every 30 seconds, however I see tick marks every minute.

I traced the problem to AbstractAxis#layoutChildren, line 1255:
setTickUnit(computePreferredTickUnit(axisLength));
As far as I can see, this always recomputed the tick unit - even when a tick unit has been specifically set by the user.

If I change this line to
setTickUnit(getTickUnit());
I get the expected behaviour.

Example:
DEMO_TickUnit.txt

Actual:
2020-03-19_DemoTickUnit_30_withoutChange

Expected/after adapting AbstractAxis:
2020-03-19_DemoTickUnit_30_withChange

The first and last bins of histograms are not drawn - FIXED

It seems that the first and last bins of histograms are not drawn. Is this the intended behavior of the render?

The following chart was generated with version 8.1.1 using the ErrorDataSetRenderer with two DefaultNumericAxis using PolyLineStyle LineStyle.HISTOGRAM and ErrorType ErrorStyle.NONE. The only dataset was a Histogram constructed using the double[] bins option to set the start and end position of all bins. It is just random sampling of a gaussian distribution.

Screenshot 2020-01-16 at 09 06 15

Performance Canvas.save()

I saw your comments on performance in your README. One thing I noticed in your code and that made a big difference for my Gantt chart control FlexGanttFX was to not use Canvas.save() / Canvas.restore(). These are expensive operations. You can get away by simply reverting any changes you made to the canvas. E.g. after calling setTranslateX(10) call setTranslateX(0) once you are done painting. Yes, this is more work and if you forget to reset a transformation you will see side effects but it is worth the effort if you need faster drawing.

Tick are still computed even if all three minor-tick, tick-label, and tick-mark are set to not visible - SOLVED

Hi!

So I'm using the XYChart and stripped it to the bare minimum, i.e. the plotted data and the legend. I discovered that when creating a bunch of new charts, i.e. up to 24 at once, the creation time was pretty significant in my case. Profiling the creation of the charts revealed that the computation of the tick info is the culprit, more precisely AbstractAxis.recomputeTickMarks(AxisRange):
image

The current workaround I've found is to basically make a new implementation of AbstractAxis which is the same as NumericAxis but without the calculation of the tick marks. This works but ends up in a bunch of code duplication and isn't ideal.

Ideally either of the two following options would work great for me:

  • NumericAxis is smart about the computation of the tick marks regarding the state of the properties: minorTickVisible, tickLabelsVisible, and tickMarkVisible.
  • NumericAxis isn't final and allows to make such modification via overriding.

I realize this is probably a singular setup and that the first option would require some work with little benefit for you. maybe I could help if that'd be the desired option.

Thank you!

working with module-info.java

Hi,

First of all, thanks for providing such a great library and for maintaining it.

I use gradle. chart-fx works perfectly fine until I make my project modular.

I started with a simple project that has an fxml with one label. my controller sets the label and my main class which extends Application just loads the xml. I made my application modular and inside my build.gradle I added
compile group: 'de.gsi.chart', name: 'chartfx-chart', version: '11.1.0'

and when I run it from gradle I get the following error

> Task :run FAILED
Error occurred during initialization of boot layer
java.lang.module.FindException: Unable to derive module descriptor for C:\Users\user\.gradle\caches\modules-2\files-2.1\org.apache.xmlgraphics\batik-script\1.8\5bda6a9d45065b184c83c46b64d8002b4e0ab7c7\batik-script-1.8.jar
Caused by: java.lang.module.InvalidModuleDescriptorException: Provider class org.apache.batik.bridge.RhinoInterpreterFactory not in module

I am using intelij, java jdk 11.0.6 and javafx 14.

Am I missing anything else?

Thank you!

EDIT:
Without module-info.java
When I use javafx 13, I get the following error
Error occurred during initialization of boot layer java.lang.module.FindException: Module javafx.base not found
When I use javafx 14, it works.

I include javafx like this

javafx {
    version = "14"
    modules = [ 'javafx.controls', 'javafx.fxml', 'javafx.base', 'javafx.graphics' ]
}

Any way to change color scheme?

Hi, thanks for the great charting library.

Is there any way to change the color scheme to the one from default JavaFX charts? chart.css doesn't use the colors that I see on the screen and I see that ErrorDataSetRenderer uses static calls to DefaultRenderColorScheme, but doesn't seem to have a method to set another scheme. DefaultRenderColorScheme does have different color arrays as fields, but again, I see no way to change which one is used or to add my own. I'd also like to disable hatching and symbols and just draw the lines themselves. FillPattern seems to have "solid" as an option, but it's not used anywhere, as far as I can tell. Am I missing something?

As a side question: is there any way to break up the data inside one dataset? I'm getting series of independent readings from the same sensors over time and I don't want to create a bunch of new datasets for each one, as that would look confusing. So I want clear space to separate them, but by default the last point of the previous series and the first point of the new one would get connected, as if it's the same series (which makes sense of course, but it's not what I want). In vanilla JavaFX charts I could traverse the node path and replace LineTo with MoveTo, which was very cumbersome, but generally worked. What's the approach here?

TickLabel clashing and misalignment when rotated -90 - SOLVED

Thanks for developing this awesome plotter! The performance and features are fantastic!

I noticed if I use setTickLabelRotation(-90) on the y-axis, the TickLabels frequently clash and are not centered on the tick mark locations. I realize this might be an unusual use, but I would like to put a set of charts in a VBox and link their x-axes. In this case, it is nice to rotate the y-axis labels, so that the x-axes always remain aligned. Otherwise, differences in the digit number will cause the charts to be offset.

Do you have a suggestion about how to resolve the tick label clashing and alignment for this orientation?

Screenshot 2019-11-12 at 14 22 59

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.