Skip to content

Using the JSON reporter to generate graphs

Harry Cummings edited this page Feb 14, 2015 · 4 revisions

The JSON reporter can be used to generate graphs locally rather than using plotly.

Chart.js

To use Chart.js you would need config like the following:

config.json

....
"reporters": {
    "console": null,
    "json": {
        "filename": "chart.json",
        "plotListKey": "datasets",
        "plotNameKey": "label",
        "build": "$BUILD_NUMBER"
    }
}
....

And HTML as in this Gist.

Chartist

To use Chartist, you would need config like the following:

"reporters": {
    "console": null,
    "json": {
        "filename": "chart.json",
        "plotListKey": "series",
        "plotNameKey": "name",
        "build": "$BUILD_NUMBER"
    }
}

And HTML something like the 'Line Chart With Tooltips' example on http://gionkunz.github.io/chartist-js/examples.html

Clone this wiki locally