code: function (data){
                              // set data
                              if (!arguments.length) {
                                  if (scope.options.chart.type === 'sunburstChart') {
                                      data = angular.copy(scope.data);
                                  } else {
                                      data = scope.data;
                                  }
                              } else {
                                  scope.data = data;
  
                                  // return if data $watch is enabled
                                  if (scope._config.deepWatchData && !scope._config.disabled) return;
                              }
  
                              if (data) {
                                  // remove whole svg element with old data
                                  d3.select(element[0]).select('svg').remove();
  
                                  var h, w;
  
                                  // Select the current element to add <svg> element and to render the chart in
                                  scope.svg = d3.select(element[0]).insert('svg', '.caption');
                                  if (h = scope.options.chart.height) {
                                      if (!isNaN(+h)) h += 'px'; //check if height is number
                                      scope.svg.attr('height', h).style({height: h});
                                  }
                                  if (w = scope.options.chart.width) {
                                      if (!isNaN(+w)) w += 'px'; //check if width is number
                                      scope.svg.attr('width', w).style({width: w});
                                  } else {
                                      scope.svg.attr('width', '100%').style({width: '100%'});
                                  }
  
                                  scope.svg.datum(data).call(scope.chart);
  
                                  // update zooming if exists
                                  if (scope.chart && scope.chart.zoomRender) scope.chart.zoomRender();
                              }
                          }
docs: Update chart with new data