Home Unable to create graphs using highcharts-ng in meanjs. how to create graphs from the existing table in MEANJS
Reply: 0

Unable to create graphs using highcharts-ng in meanjs. how to create graphs from the existing table in MEANJS

user2174
1#
user2174 Published in July 21, 2018, 8:48 pm

I have tried using highcharts-ng to create graphs in MEANJS but its not working. What is highcharts-ng's best alternative.

1.I have installed highcharts using

bower install highcharts-ng

2. Include it in applicationModuleVendorDependencies

var applicationModuleVendorDependencies = ['ngResource', 'ui.router', 'ui.bootstrap', 'ui.utils','highcharts-ng'];

3.included in the assets lib

assets: {
    lib: {
        css: [
            'public/lib/bootstrap/dist/css/bootstrap.css',
            'public/lib/bootstrap/dist/css/bootstrap-theme.css',
        ],
        js: [
            'public/lib/angular/angular.js',
            'public/lib/angular-resource/angular-resource.js', 
            'public/lib/angular-ui-router/release/angular-ui-router.js',
            'public/lib/angular-ui-utils/ui-utils.js',
            'public/lib/angular-bootstrap/ui-bootstrap-tpls.js',
            'public/lib/highstock/js/highcharts.src.js',
            'public/lib/highcharts-ng/dist/highcharts-ng.js',
            'public/lib/file-saver/FileSaver.js'
        ]

4.put the following code in Index.htm

<div ng-app="myapp">
    <div ng-controller="myctrl">
       <div class='container'>
                    <highchart id='example1' config='config'></highchart>
        </div>
    </div>
    </div>
  1. and put the following code in the controller

    var myapp = angular.module('myapp', ["highcharts-ng"]);

    myapp.controller('myctrl', function ($scope) {

    $scope.config = {
        options: {
            chart: {
                type: 'column'
            },
        },
        xAxis: {
            categories: ['Yes', 'No']
        },
        series: [{
            name: 'Votes',
            data: [0, 0]
        }],
        title: {
            text: 'Data-binding Example'
        },
        subtitle: {
            text: 'Is this easy?'
        },
        credits: {
            enabled: false
        },
        loading: false
    };
    

The view shows no graph.Am I missing some thing? Thank you.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.3125 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO