Dygraphs-GWT is a wrapper for the dygraphs chart library. The wrapper makes it easy to use dygraphs in any GWT application by providing a type-safe abstraction of the dygraphs API.
Following dygraphjs example:
new Dygraph(div, "ny-vs-sf.txt", {
legend: 'always',
title: 'NYC vs. SF',
showRoller: true,
rollPeriod: 14,
customBars: true,
ylabel: 'Temperature (F)',
});
can be done with the wrapper this way:
DygraphsOptions options = new DygraphsOptions();
options.legend='always'
options.title='NYC vs. SF'
options.showRoller = true;
options.rollPeriod = 14;
options.customBars = true;
options.ylabel = 'Temperature (F)'
Dygraphs dygraphs = new Dygraphs("ny-vs-sf.txt",options);
somePanel.add(dygraphs);
If you're using Maven, you can add the following to your <dependencies>
section:
<dependency>
<groupId>com.github.timeu.dygraphs-gwt</groupId>
<artifactId>dygraphs-gwt</artifactId>
<version>1.0.0</version>
</dependency>
GeneViewer uses GWT 2.8's new JSInterop feature and thus it has to be enabled in the GWT compiler args. For maven:
<compilerArgs>
<compilerArg>-generateJsInteropExports</compilerArg>
</compilerArgs>
or passing it to the compiler via -generateJsInteropExports
You can also download the jar directly or check out the source using git from https://github.com/timeu/dygraphs-gwt.git and build it yourself. Once you've installed Dygraphs-GWT, be sure to inherit the module in your .gwt.xml file like this:
<inherits name='com.github.timeu.Dygraphs'/>
- Check out the sample app (Source Code) for a full example of using GeneViewer.