docs: function(options){
                              // set options
                              if (!arguments.length) {
                                  options = scope.options;
                              } else {
                                  scope.options = options;
  
                                  // return if options $watch is enabled
                                  if (scope._config.deepWatchOptions && !scope._config.disabled) return;
                              }
  
                              // Clearing
                              scope.api.clearElement();
  
                              // Exit if options are not yet bound
                              if (angular.isDefined(options) === false) return;
  
                              // Exit if chart is hidden
                              if (!scope._config.visible) return;
  
                              // Initialize chart with specific type
                              scope.chart = nv.models[options.chart.type]();
  
                              // Generate random chart ID
                              scope.chart.id = Math.random().toString(36).substr(2, 15);
  
                              angular.forEach(scope.chart, function(value, key){
                                  if (key[0] === '_');
                                  else if ([
                                          'clearHighlights',
                                          'highlightPoint',
                                          'id',
                                          'options',
                                          'resizeHandler',
                                          'state',
                                          'open',
                                          'close',
                                          'tooltipContent'
                                      ].indexOf(key) >= 0);
  
                                  else if (key === 'dispatch') {
                                      if (options.chart[key] === undefined || options.chart[key] === null) {
                                          if (scope._config.extended) options.chart[key] = {};
                                      }
                                      configureEvents(scope.chart[key], options.chart[key]);
                                  }
  
                                  else if ([
                                          'bars',
                                          'bars1',
                                          'bars2',
                                          'boxplot',
                                          'bullet',
                                          'controls',
                                          'discretebar',
                                          'distX',
                                          'distY',
                                          'focus',
                                          'interactiveLayer',
                                          'legend',
                                          'lines',
                                          'lines1',
                                          'lines2',
                                          'multibar',
                                          'pie',
                                          'scatter',
                                          'scatters1',
                                          'scatters2',
                                          'sparkline',
                                          'stack1',
                                          'stack2',
                                          'sunburst',
                                          'tooltip',
                                          'x2Axis',
                                          'xAxis',
                                          'y1Axis',
                                          'y2Axis',
                                          'y3Axis',
                                          'y4Axis',
                                          'yAxis',
                                          'yAxis1',
                                          'yAxis2'
                                      ].indexOf(key) >= 0 ||
                                          // stacked is a component for stackedAreaChart, but a boolean for multiBarChart and multiBarHorizontalChart
                                      (key === 'stacked' && options.chart.type === 'stackedAreaChart')) {
                                      if (options.chart[key] === undefined || options.chart[key] === null) {
                                          if (scope._config.extended) options.chart[key] = {};
                                      }
                                      configure(scope.chart[key], options.chart[key], options.chart.type);
                                  }
  
                                  //TODO: need to fix bug in nvd3
                                  else if ((key === 'focusHeight') && options.chart.type === 'lineChart');
                                  else if ((key === 'focusHeight') && options.chart.type === 'lineWithFocusChart');
                                  else if ((key === 'xTickFormat' || key === 'yTickFormat') && options.chart.type === 'lineWithFocusChart');
                                  else if ((key === 'tooltips') && options.chart.type === 'boxPlotChart');
                                  else if ((key === 'tooltipXContent' || key === 'tooltipYContent') && options.chart.type === 'scatterChart');
                                  else if ((key === 'x' || key === 'y') && options.chart.type === 'forceDirectedGraph');
  
                                  else if (options.chart[key] === undefined || options.chart[key] === null){
                                      if (scope._config.extended) {
                                          if (key==='barColor')
                                              options.chart[key] = value()();
                                          else
                                              options.chart[key] = value();
                                      }
                                  }
  
                                  else scope.chart[key](options.chart[key]);
                              });
  
                              // Update with data
                              scope.api.updateWithData();
  
                              // Configure wrappers
                              if (options['title'] || scope._config.extended) configureWrapper('title');
                              if (options['subtitle'] || scope._config.extended) configureWrapper('subtitle');
                              if (options['caption'] || scope._config.extended) configureWrapper('caption');
  
  
                              // Configure styles
                              if (options['styles'] || scope._config.extended) configureStyles();
  
                              nv.addGraph(function() {
                                  if (!scope.chart) return;
  
                                  // Remove resize handler. Due to async execution should be placed here, not in the clearElement
                                  if (scope.chart.resizeHandler) scope.chart.resizeHandler.clear();
  
                                  // Update the chart when window resizes
                                  scope.chart.resizeHandler = nv.utils.windowResize(function() {
                                      scope.chart && scope.chart.update && scope.chart.update();
                                  });
  
                                  /// Zoom feature
                                  if (options.chart.zoom !== undefined && [
                                          'scatterChart',
                                          'lineChart',
                                          'candlestickBarChart',
                                          'cumulativeLineChart',
                                          'historicalBarChart',
                                          'ohlcBarChart',
                                          'stackedAreaChart'
                                      ].indexOf(options.chart.type) > -1) {
                                      nvd3Utils.zoom(scope, options);
                                  }
  
                                  return scope.chart;
                              }, options.chart['callback']);
                          }