D3 Gauge is a Vaadin UI component based on D3. This component aims to be easy to use and customizable.
Try the add-on demo at http://kaismh.jelastic.servint.net/. The source code of the demo available here.
Official releases of this add-on are available at Vaadin Directory. For Maven instructions, download and reviews, go to http://vaadin.com/addon/d3Gauge
git clone https://github.com/kaismh/vaadin-gauge.git
mvn clean install
cd d3Gauge-demo
mvn jetty:run
To see the demo, navigate to http://localhost:8080/
The following features are planned for upcoming releases:
- Better Documentation
- Make the Gauge responsive
The issues for this add-on are tracked on the issues page. All bug reports and feature requests are appreciated.
Using the Gauge is straight forward, if you want to keep the default style and configuration, create a new instance of Gauge class and add it to a container.
Gauge gauge = new Gauge("Memory",76,200);
layout.addComponent(gauge);
If you want to change the configuration or style, create a new instance of GaugeConfig class and pass it to the Gauge constructor.
GaugeConfig config = new GaugeConfig();
config.setStyle(GaugeStyle.STYLE_DARK.toString());
config.setMin(-100);
Gauge gauge = new Gauge("Custom",14,200,config);
layout.addComponent(gauge);
For a more comprehensive example, see the demo project.
The JavaScript code is mainly based on Tomerd and Paulinm
Add-on is distributed under Apache License 2.0. For license terms, see LICENSE.txt.
Vaadin D3 Gauge is written by Kais Hassan