GithubHelp home page GithubHelp logo

rootux / angular-highcharts-directive Goto Github PK

View Code? Open in Web Editor NEW
160.0 160.0 70.0 131 KB

An Angular Js Directive which allows to simplify the use of Highcharts charts

License: MIT License

JavaScript 100.00%

angular-highcharts-directive's Introduction

Hi there ๐Ÿ‘‹

I'm a solution architect. Love everything web & scalability

angular-highcharts-directive's People

Contributors

bcamp1973 avatar bitdeli-chef avatar nichochar avatar powerkiki avatar rootux avatar sercaneraslan avatar stissot avatar zhuangya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-highcharts-directive's Issues

Events in configuration - not working

When trying to use events in configuration, we cannot pass functions as the angular-highcharts-directive parses the configuration as JSON which doesn't allow functions. This sucks.

$http.get('/api/chart').success(function (data) {
   data.plotOptions.scatter.point = {
      events: {
         click: function(event) {
            console.log('scatter point event click'); // this doesn't fire
         }
      }
   }
   $scope.chart = data;
});

chart is undefined inside the watch

i had to change a line in your directive to get it work using your data for compatibility i reccomend you merge these. Sorry, for not making a commit myself

return {
    restrict: 'ACE',
    template: '<div></div>',
    scope: {
        chartData: "=value",
        chartObj: "=?"
    },
    transclude: true,
    replace: true,
    link: function($scope, $element, $attrs) {

        //Update when charts data changes
        $scope.$watch('chartData', function(value) {
            if (!value)
                return;
            if (!$scope.chartData.chart) <--- THIS LINE
                $scope.chartData.chart = {}; <--- ALSO THIS
            // use default values if nothing is specified in the given settings
            $scope.chartData.chart.renderTo = $scope.chartData.chart.renderTo || $element[0];
            if ($attrs.type)
                $scope.chartData.chart.type = $scope.chartData.chart.type || $attrs.type;
            if ($attrs.height)
                $scope.chartData.chart.height = $scope.chartData.chart.height || $attrs.height;
            if ($attrs.width)
                $scope.chartData.chart.width = $scope.chartData.chart.type || $attrs.width;

            $scope.chartObj = new Highcharts.Chart($scope.chartData);
        });
    }
};

Version #0.4.0

FYI, i noticed there isn't a tag corresponding to the current version of the lib. If you just run the following commands people will be able to specify the version they want...

$ git tag v0.4.0
$ git push origin v0.4.0

get svg code from highchart

in normal highchart i get svg code with code like this

var chart = $('#container').highcharts()
svg = chart.getSVG();

So, how can i get svg code with this directive???
i try like normal code but i didn't get svg code.
Thank's....

Error when running example in Firefox

Error: Invalid isolate scope definition for directive chart: =?
$CompileProvider/this.$get</applyDirectivesToNode/nodeLinkFn/<@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js:4196
forEach@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js:117
nodeLinkFn@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js:4142
compositeLinkFn@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js:3848
compositeLinkFn@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js:3854
publicLinkFn@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js:3763
update@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js:13890
$RootScopeProvider/this.$get</Scope.prototype.$broadcast@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js:8090
$RouteProvider/this.$get</updateRoute/<@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js:7250
qFactory/defer/deferred.promise.then/wrappedCallback@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js:6650
qFactory/defer/deferred.promise.then/wrappedCallback@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js:6650
qFactory/ref/<.then/<@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js:6687
$RootScopeProvider/this.$get</Scope.prototype.$eval@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js:7840
$RootScopeProvider/this.$get</Scope.prototype.$digest@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js:7707
$RootScopeProvider/this.$get</Scope.prototype.$apply@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js:7926
done@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js:8933
completeRequest@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js:9073
createHttpBackend/</xhr.onreadystatechange@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js:9044

https://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js
Line 5582

Chart directive doesn't work when rendering in a carousel

If you try to use this directive for Highcharts in a carousel, it results in the following error:

TypeError: Cannot read property 'length' of undefined at Object.ob.setMaxTicks

This seems to be caused by the following css in Bootstrap:

.carousel-inner > .item { display: none }

If I add an override with "display: block" to my stylesheet, everything
works, but the charts are stacked instead of in a carousel. The good news
is all the charts are rendered successfully.

A seemingly better solution is to modify the directive to show/hide the
"item" element so Highcharts is able to write to it.

if (element.parent().not(':visible')) {
    element.parent().show();
}

var chart = new Highcharts.Chart(newSettings);

if (scope.$last) {
    $.each(element.parent().siblings(), function() {
        $(this).attr('style', '');
    });
    element.parent().attr('style', '');
}

More info at https://groups.google.com/group/angular/browse_thread/thread/5a5cc0f0ed98104f/652d8b52dbbe0709

[enhancement] Add missing bower.json.

Hey, maintainer(s) of rootux/angular-highcharts-directive!

We at VersionEye are working hard to keep up the quality of the bower's registry.

We just finished our initial analysis of the quality of the Bower.io registry:

7530 - registered packages, 224 of them doesnt exists anymore;

We analysed 7306 existing packages and 1070 of them don't have bower.json on the master branch ( that's where a Bower client pulls a data ).

Sadly, your library rootux/angular-highcharts-directive is one of them.

Can you spare 15 minutes to help us to make Bower better?

Just add a new file bower.json and change attributes.

{
  "name": "rootux/angular-highcharts-directive",
  "version": "1.0.0",
  "main": "path/to/main.css",
  "description": "please add it",
  "license": "Eclipse",
  "ignore": [
    ".jshintrc",
    "**/*.txt"
  ],
  "dependencies": {
    "<dependency_name>": "<semantic_version>",
    "<dependency_name>": "<Local_folder>",
    "<dependency_name>": "<package>"
  },
  "devDependencies": {
    "<test-framework-name>": "<version>"
  }
}

Read more about bower.json on the official spefication and nodejs semver library has great examples of proper versioning.

NB! Please validate your bower.json with jsonlint before commiting your updates.

Thank you!

Timo,
twitter: @versioneye
email: [email protected]
VersionEye - no more legacy software!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.