docs: function ChartLegend () {
      var legendLinker = function (scope, element, attrs, chartCtrl) {
          var legend = null;
          var show = attrs.showLegend;
          if (show && show === "false") {
              legend = {"show": false};
          } else {
              var position = attrs.legendPosition;
              if (position) {
                  legend = {"position": position};
              }
              var inset = attrs.legendInset;
              if (inset) {
                  legend = {"position":"inset","inset":{"anchor":inset}};
  
                  var insetX = attrs.legendInsetX;
                  if (insetX) {
                      legend.inset.x = parseInt(insetX);
                  }
                  var insetY = attrs.legendInsetY;
                  if (insetY) {
                      legend.inset.y = parseInt(insetY);
                  }
                  var insetStep = attrs.legendInsetStep;
                  if (insetStep) {
                      legend.inset.step = parseInt(insetStep);
                  }
              }
          }
  
          if (attrs.onMouseover) {
              legend = legend || {};
              legend.item = legend.item || {};
              legend.item.onmouseover = function (data) {
                  scope.$apply(function () {
                      scope.onMouseover({"data": data});
                  });
              };
          }
          if (attrs.onMouseout) {
              legend = legend || {};
              legend.item = legend.item || {};
              legend.item.onmouseout = function (data) {
                  scope.$apply(function () {
                      scope.onMouseout({"data": data});
                  });
              };
          }
          if (attrs.onClick) {
              legend = legend || {};
              legend.item = legend.item || {};
  
              legend.item.onclick = function (data) {
                  scope.$apply(function () {
                      scope.onClick({"data": data});
                  });
              };
          }
  
          if (legend != null) {
              chartCtrl.addLegend(legend);
          }
      };
  
      return {
          "require": "^c3chart",
          "restrict": "E",
          "scope": {
              "onMouseover": "&",
              "onMouseout": "&",
              "onClick": "&"
          },
          "replace": true,
          "link": legendLinker
      };
  }