Friday, 8 January 2021

Java Chart Frameworks

JFree chart is the most recommended one.  


The major elements are involved as using JFree framework. 

ChartPanel: it is specific to the JFree; it is a container to hold the JFree charts, and it adapts to the SWING frame.   

XYPlot: it is the basic plotter, that draws an x-y diagram on the canvas. 

Axis: Date axis(X-axis) or Number axis(Y-axis) stands for Price or volume. 

Dataset: Candle dataset; or XY data set.


JFree candlestick chart, combined subplots. 

https://examples.javacodegeeks.com/desktop-java/jfreechart/jfree-candlestick-chart-example/


Creating a candlestick chart and line chart on a common chart

XYPlot plot = (XYPlot)chart.getPlot();
        XYDataset dataset2 = getDataset2(); //This is where you get your line data
        plot.setRenderer(1, new XYLineAndShapeRenderer(true, false));
        plot.setDataset(1, dataset2);


It is supposed to work with Java FX, via a Jfree-fx package. However,  I didn't make it work. The chart-viewer has a version error. 

Java FX candlestick chart

https://github.com/rterp/StockChartsFX


ChartFx is a scientific charting library developed at GSI for FAIR with focus 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 common in digital signal processing applications. Based on earlier Swing-based designs used at GSI and CERN, it is a re-write of JavaFX's default Chart implementation and aims to preserve the feature-rich and extensible functionality of earlier and other similar Swing-based libraries while addressing the performance bottlenecks and API issues. The motivation for the re-design has been presented at IPAC'19 (paperposter).


https://github.com/GSI-CS-CO/chart-fx


Java FX structure 

Application: have Stage(s); a Stage has a Scene; a Scene has a root Node, Node has children Nodes. 

TreeViewTable: combine tree view and table view together.

SplitPane: 

CombinedSubPlots

ChartViewer: Jfree-fx allows JFree Chart display on the Java FX 



How to integrate Java FX with SpringBoot


https://github.com/mvpjava/springboot-javafx-tutorial


Tutorial: Reactive Spring Boot Part 3 – A JavaFX Spring Boot Application

 








No comments:

Can Jackson Deserialize Java Time ZonedDateTime

Yes, but must include JSR310. Thus ZonedDateTime can be deserialized directly from JSON response to POJO field. <dependency> <g...