This project wraps the JavaScript library highcharts for use with Vaadin 7 and 8.
Try one of the add-on demos:
Official releases of this add-on are available at Vaadin Directory. For Maven instructions, download and reviews, go to https://vaadin.com/addon/highcharts-for-vaadin-7.
-
Download jquery and
highcharts.js
(if not already loaded in your webapp) and save them in the resource directoryorg/vaadin/highcharts
. -
Create a new class in the package
org.vaadin.highcharts
(e.g.HighChart
) and inherit it fromAbstractHighChart
. -
Add a proper
@JavaScript
annotation to the newly created class in order to load all necessary JavaScript libraries that you need (e.g.jquery.js
,highcharts.js
,highcharts-more.js
, ...). Make sure your project complies with the licenses of those libraries. At the end of this list add "highcharts-connector.js". Here is an example:package org.vaadin.highcharts; @JavaScript({"jquery-min.js", "highcharts.js", "highcharts-connector.js"}) public class HighChart extends AbstractHighChart { private static final long serialVersionUID = -7326315426217377753L; }
-
Instantiate a HighChart object, set the chart code, and add it to the layout of your UI:
// Create and configure a chart. HighChart chart = new HighChart(); chart.setHcjs("var options = { title: { text: 'test diagram' }, series: [{ name: 's1', data: [1, 3, 2]}] };") someLayout.add(chart)
git clone https://github.com/xylo/highcharts-vaadin7.git
cd highcharts-vaadin7
mvn package
mvn -Pdemo exec:java
To see the demo, navigate to http://localhost:9998/
- Import to your favourite IDE
- Run the
main
method of theServer
class (org.vaadin.highcharts.uiserver.Server
) to launch embedded web server that lists all your test UIs athttp://localhost:9998
- Code and test
- create UI's for various use cases for your add-ons, see examples. These can also work as usage examples for your add-on users.
- create browser level and integration tests under src/test/java/
- Browser level tests are executed manually from IDE (JUnit case) or with Maven profile
browsertests
(mvn verify -Pbrowsertests
). If you have a setup for solidly working Selenium driver(s), consider enabling that profile by default.
- Test also in real world projects, e.g. create a demo project, build a snapshot release (
mvn install
) and use the snapshot build in it.
- Use Maven release plugin (mvn release:prepare; mvn release:perform)
- Upload the ZIP file generated to target/checkout/target directory to https://vaadin.com/directory service (and/or optionally publish your add-on to Maven central)
- made add-on compatible with vaadin 8
- added support for stock charts
- added function
manipulateChart
for manipulating charts dynamically - restructured the whole project (from multi-module to single-module)
- minor changes
- initial version of the Highcharts wrapper for Vaadin 7
This component is developed as a hobby with no public roadmap or any guarantees of upcoming releases.
The issues for this add-on are tracked on its github.com page. All bug reports and feature requests are appreciated.
Contributions are welcome, but there are no guarantees that they are accepted as such. Process for contributing is the following:
- Fork this project
- Create an issue to this project about the contribution (bug or feature) if there is no such issue about it already. Try to keep the scope minimal.
- Develop and test the fix or functionality carefully. Only include minimum amount of code needed to fix the issue.
- Refer to the fixed issue in commit
- Send a pull request for the original project
- Comment on the original issue that you have implemented a fix for it
Add-on is distributed under Apache License 2.0. For license terms, see LICENSE.txt.
Highcharts for Vaadin 7+ is written by Stefan Endrullis.