1.0.0 • Published 7 years ago

c3-exporter v1.0.0

Weekly downloads
2,007
License
MIT
Repository
github
Last release
7 years ago

c3-exporter

npm version npm downloads dependency Status devDependency Status

Export c3 charts to png

Install

npm i -S c3-exporter

Example

Test in RuKit

const c3Exporter = require('c3-exporter')

const options = {
  data: {
    columns: [
      ['data1', 30, 150, 100, 400, 150, 250],
      ['data2', 50, 20, 10, 40, 15, 25]
    ],
    type: 'spline'
  },
  padding: {
    top: 10,
    bottom: 10,
    right: 15,
    left: 15
  },
  size: {
    width: 320,
    height: 320
  }
}
const size = '320x320' // optional. Default is '320x320'

c3Exporter(options, size).then(content => {
  console.log(content) // A Buffer with content of image chart
  fs.writeFile('chart.png', content, err => {
    if (err) throw err
    console.log('Chart saved!')
  })
}).catch(console.error)

License

MIT

1.0.0

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago