chart-generator-for-highcharts-js

4.0.4 • Public • Published

Highchart Generator using node js, bootstrap and Highcharts api

This module supports Jade templating language.

Installation steps:

  1. npm install chart-generator-for-highcharts-js

  2. npm install

  3. in your app.js file do the following:

    1. Include the package var hc = require('chart-generator-for-highcharts-js'); and add the following lines app.use(hc);
  4. in the routes folder access the index.js file add the following line to render the content routes / index.js

    var express = require('express'); var router = express.Router(); var hc = require('chart-generator-for-highcharts-js');

    /* GET home page. */ router.get('/', function(req, res, next) {

    res.render('index', { title: 'Express', hc: hc}); });

    module.exports = router;

  5. in the main jade file add the following lines of code views/index.jade

     div#dataForm
             script(src="https://code.highcharts.com/highcharts.js")
             script(src="https://code.highcharts.com/modules/funnel.js")
             script(src="https://code.highcharts.com/modules/exporting.js")
             script(src="/javascripts/index.js")
     div(id="tabs" style="display:none;")
         ul.nav.nav-tabs
             li.active
                 a(href='#pieChart' id="pie" onclick='init(); showPie();' data-toggle="tab") Pie Chart
             li
                 a(href='#barChart' id="bar" onclick='init(); showBar();'  data-toggle="tab") Bar Chart
             li
                 a(href='#lineChart' id="line" onclick='init(); showLine();'  data-toggle="tab") Pyramid Chart
     
         div
             div(id="pieChart" class="charts",style="display:none;width:42%;")
                 h2.
                     Pie Charts
             div(id="barChart" class="charts",style="display:none;width:45%;")
                 h2.
                     Column Chart
             div(id="lineChart" class="charts",style="display:none;width:45%;")
                 h2.
                     Pyramid Chart
    

Supports use of pie charts, bar chart and pyrmaid graphs. NB: Any data values entered for data fields must be numeric or it wont render.

Readme

Keywords

none

Package Sidebar

Install

npm i chart-generator-for-highcharts-js

Weekly Downloads

0

Version

4.0.4

License

ISC

Last publish

Collaborators

  • jadeos4