exist-db / jfreechart Goto Github PK
View Code? Open in Web Editor NEWJFreeChart extension for eXist-db
License: GNU Lesser General Public License v2.1
JFreeChart extension for eXist-db
License: GNU Lesser General Public License v2.1
Various Maven Plugins in the pom.xml
are missing explicit versions. These should be added to ensure the stability of the build.
@ljo write some readers that could be used by the original project:
https://github.com/eXist-db/jfreechart/tree/develop/src/main/java/org/jfree/data/xml
They have been offered before, let's try again.
it does support the XYdataseries... probably easy to add
Replacing the batik libraries with JFreeSVG will save a lot of space (44k in stead of 3-4 Meg) and will prevent potential JAR collisions.
License must be checked (AGPL) which is probably incompatible with L-GPL 2.1
http://www.jfree.org/phpBB2/viewforum.php?f=32
http://www.jfree.org/jfreesvg/
http://dolf.trieschnigg.nl/jfreechart/
2019-05-05 14:12:35,815 [qtp1906335777-103] ERROR (EXistServlet.java [doGet]:285) - org.exist.validation.internal.node.NodeInputStream.<init>(Lorg/exist/storage/serializers/Serializer;Lorg/exist/xquery/value/NodeValue;)V
java.lang.NoSuchMethodError: org.exist.validation.internal.node.NodeInputStream.<init>(Lorg/exist/storage/serializers/Serializer;Lorg/exist/xquery/value/NodeValue;)V
at org.exist.xquery.modules.jfreechart.JFreeCharting.eval(JFreeCharting.java:153) ~[exist-jfreechart-0.4.jar:?]
at org.exist.xquery.BasicFunction.eval(BasicFunction.java:74) ~[exist-core-5.0.0-RC8-SNAPSHOT.jar:5.0.0-RC8-SNAPSHOT]
at org.exist.xquery.InternalFunctionCall.eval(InternalFunctionCall.java:41) ~[exist-core-5.0.0-RC8-SNAPSHOT.jar:5.0.0-RC8-SNAPSHOT]
at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:58) ~[exist-core-5.0.0-RC8-SNAPSHOT.jar:5.0.0-RC8-SNAPSHOT]
at org.exist.xquery.LetExpr.eval(LetExpr.java:111) ~[exist-core-5.0.0-RC8-SNAPSHOT.jar:5.0.0-RC8-SNAPSHOT]
at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71) ~[exist-core-5.0.0-RC8-SNAPSHOT.jar:5.0.0-RC8-SNAPSHOT]
at org.exist.xquery.PathExpr.eval(PathExpr.java:276) ~[exist-core-5.0.0-RC8-SNAPSHOT.jar:5.0.0-RC8-SNAPSHOT]
at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71) ~[exist-core-5.0.0-RC8-SNAPSHOT.jar:5.0.0-RC8-SNAPSHOT]
at org.exist.xquery.XQuery.execute(XQuery.java:261) ~[exist-core-5.0.0-RC8-SNAPSHOT.jar:5.0.0-RC8-SNAPSHOT]
at org.exist.xquery.XQuery.execute(XQuery.java:185) ~[exist-core-5.0.0-RC8-SNAPSHOT.jar:5.0.0-RC8-SNAPSHOT]
at org.exist.http.RESTServer.executeXQuery(RESTServer.java:1512) ~[exist-core-5.0.0-RC8-SNAPSHOT.jar:5.0.0-RC8-SNAPSHOT]
at org.exist.http.RESTServer.doGet(RESTServer.java:520) ~[exist-core-5.0.0-RC8-SNAPSHOT.jar:5.0.0-RC8-SNAPSHOT]
The (internal) api of org.exist.validation.internal.node.NodeInputStream
has been changed.
Caused by: java.lang.NoSuchMethodError: org.exist.validation.internal.node.NodeInputStream.<init>(Lorg/exist/Database;Lorg/exist/storage/serializers/Serializer;Lorg/exist/xquery/value/NodeValue;)V
at org.exist.xquery.modules.jfreechart.JFreeCharting.eval(JFreeCharting.java:140)
at org.exist.xquery.functions.response.StrictResponseFunction.eval(StrictResponseFunction.java:51)
at org.exist.xquery.functions.response.ResponseFunction.eval(ResponseFunction.java:48)
at org.exist.xquery.BasicFunction.eval(BasicFunction.java:73)
at org.exist.xquery.InternalFunctionCall.eval(InternalFunctionCall.java:62)
at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:58)
at org.exist.xquery.LetExpr.eval(LetExpr.java:110)
at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71)
at org.exist.xquery.PathExpr.eval(PathExpr.java:279)
at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71)
at org.exist.xquery.XQuery.execute(XQuery.java:373)
at org.exist.xquery.XQuery.execute(XQuery.java:295)
at org.exist.http.RESTServer.executeXQuery(RESTServer.java:1566)
at org.exist.http.RESTServer.doGet(RESTServer.java:517)
at org.exist.http.servlets.EXistServlet.doGet(EXistServlet.java:324)
... 66 more
The showcase is right now a simple collection of a few charts.
Without too much effort we could make a simple UI with a drop down-selection box containing the ChartNames, and an example chart just below that.
Ideally a xquery function would be available to get the list of supported charts, with some meta information e.g. to describe what type of XML data is required for that chart.
Drawback.... redundancy and additional maintenance.
Inspiration on http://www.jfree.org/phpBB2/viewtopic.php?f=3&t=28009
public class CustomDatasetReader extends DatasetReader {
public static XYDataset readXYDatasetFromXML(InputStream in) throws IOException {
XYDataset result = null;
SAXParserFactory factory = SAXParserFactory.newInstance();
try {
SAXParser parser = factory.newSAXParser();
XYDatasetHandler handler = new XYDatasetHandler();
parser.parse(in, handler);
result = handler.getDataset();
} catch (SAXException e) {
System.out.println(e.getMessage());
} catch (ParserConfigurationException e2) {
System.out.println(e2.getMessage());
}
return result;
}
}
and
public class XYDatasetHandler extends RootHandler implements DatasetTags {
public void addItem(Comparable rowKey, Comparable columnKey, Number value) {
TimeSeries timeSeries = this.dataset.getSeries(rowKey);
if (timeSeries == null) {
timeSeries = new TimeSeries(rowKey);
this.dataset.addSeries(timeSeries);
}
try {
timeSeries.add(new Day(dateFormat.parse(columnKey.toString())), value);
} catch (ParseException exc) {
// just in case the date format is wrong.
timeSeries.add(new Day(), value);
System.out.println("Date format is incorrect: " + columnKey);
}
}
}
Some time ago version 1.5 has been released; it is not a 1:1 replacement as there API changes.
Using StAX might result in better readable and maintainable code;
part of java6+
The class Cardinality.java
has been changed, this should have been a v6.0 update
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.