Giter VIP home page Giter VIP logo

jfreechart's Introduction

JFreeChart extension

Build Status Java 8 License Codacy Badge

This XAR extension provides JFreeChart functionality for eXist-db.

The XAR file is shipped with JFreeChart version 1.5 and Apache Batik SVG Toolkit version 1.11.

Installable XAR files are available on the releases page or via the eXist-db public repository.

Documentation

Some documentation can be found on the wiki of the JFreeChart extension.

Requirements

  • Java 8
  • Apache Maven 3.3+
  • Git.
  • for XAR version 0.5 and newer: eXist-db v4.6 or newer.

Contributions

Contributions are welcome via Pull requests; bugreports, ideas and suggestions can be filed using the Issues page.

Build

If you want to create an EXPath Package for the app, you can run:

$ mvn package

There will be a .xar file in the target/ sub-folder.

jfreechart's People

Contributors

adamretter avatar brihaye avatar chaeron avatar codacy-badger avatar dannesw avatar dizzzz avatar joewiz avatar lcahlander avatar ljo avatar shabanovd avatar wolfgangmm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

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

jfreechart's Issues

Build stability

Various Maven Plugins in the pom.xml are missing explicit versions. These should be added to ensure the stability of the build.

Upgrade to version 1.5

Some time ago version 1.5 has been released; it is not a 1:1 replacement as there API changes.

[BUG] extension not compatible with v5.4-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

Update showcase UI to show all available chart

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.

Extension not compatible with eXist-db v5.0

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]

Implement additional XML readers

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);
          }
        }
    }

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.