You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
509 B
13 lines
509 B
4 years ago
|
const QuickChart = require('../index');
|
||
|
|
||
|
const qc = new QuickChart();
|
||
|
|
||
|
qc.setConfig({
|
||
|
type: 'bar',
|
||
|
data: { labels: ['Hello world', 'Foo bar'], datasets: [{ label: 'Foo', data: [1, 2] }] },
|
||
|
});
|
||
|
qc.setWidth(500).setHeight(300).setBackgroundColor('transparent');
|
||
|
|
||
|
console.log(qc.getUrl());
|
||
|
// https://quickchart.io/chart?c=%7Btype%3A%27bar%27%2Cdata%3A%7Blabels%3A%5B%27Hello+world%27%2C%27Foo+bar%27%5D%2Cdatasets%3A%5B%7Blabel%3A%27Foo%27%2Cdata%3A%5B1%2C2%5D%7D%5D%7D%7D&w=500&h=300&bkg=transparent&f=png
|