zoukankan      html  css  js  c++  java
  • Angularjs中添加HighCharts

    一. 添加基本配置

      1. 添加指令

    angular.module('newApp')
      .directive('dpHighchart', ['$rootScope', function($rootScope){
        return {
          restrict: 'E',
          scope: {
            chartConfig: "="
          },
          link: function ($scope, element, $attr) {
            $scope.$watch('chartConfig', function (newValue, oldValue) {
              if (newValue) {
                $(element).highcharts($scope.chartConfig);
              }
            });
          }
        }
      }])

      2. 添加CSS样式

    dp-highchart {
      display: block;
    }

    二. 使用方法

      1. html中添加一行。

    <dp-highchart chart-config="chartConfig1"></dp-highchart>

      2. JS中添加一句。

      $scope.chartConfig1 = object(chart配置对象);

  • 相关阅读:
    mysql总结
    ContOS7 安装 java1.8
    查找
    排序
    线程通信(交替执行)
    死锁(实现)
    Rank Scores
    OpenMP
    聚类的数据量过大的问题
    编译GraphLab出错
  • 原文地址:https://www.cnblogs.com/ccblogs/p/5266442.html
Copyright © 2011-2022 走看看