Necessarily Precedes Mischief

    chartdata-convert

    0.0.1 • Public • Published

    chartdata-convert

    Library for converting data in the format for a specific library

    Supported libraries:

    • chartist
    • chart.js

    Installation

    npm install chartdata-convert
    

    Usage

    ChartDataConvert = require('chartdata-convert');
     
    options = {
      output: 'chartjs'
    };
    chartdata = new ChartDataConvert(options);
     
    data = [{
        label: 'January'
        data: [10,100,200]
      },{
        label: 'February'
        data: [20,200,300]
      },{
        label: 'March'
        data: [30,300,400]
      }
    ];
     
    chartjsdata = chartdata.convert(data);
    /*
    {
      labels: ['January', 'February', 'March']
      datasets: [
        { data: [10, 20, 30] },
        { data: [100, 200, 300] },
        { data: [200, 300, 400] }
      ]
    }
    */

    Install

    npm i chartdata-convert

    DownloadsWeekly Downloads

    1

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • maxnowack