Adding renderWatch to pieChart.

development
Robin Hu 10 years ago
parent d40193aa2d
commit 3ec2e500c2

@ -10909,7 +10909,7 @@ nv.models.pieChart = function() {
, state = {}
, defaultState = null
, noData = "No Data Available."
, dispatch = d3.dispatch('tooltipShow', 'tooltipHide', 'stateChange', 'changeState')
, dispatch = d3.dispatch('tooltipShow', 'tooltipHide', 'stateChange', 'changeState','renderEnd')
;
//============================================================
@ -10929,10 +10929,12 @@ nv.models.pieChart = function() {
nv.tooltip.show([left, top], content, e.value < 0 ? 'n' : 's', null, offsetElement);
};
var renderWatch = nv.utils.renderWatch(dispatch);
//============================================================
function chart(selection) {
renderWatch.reset();
selection.each(function(data) {
var container = d3.select(this),
that = this;
@ -11073,6 +11075,7 @@ nv.models.pieChart = function() {
});
renderWatch.renderEnd('pieChart immediate');
return chart;
}
@ -11107,7 +11110,7 @@ nv.models.pieChart = function() {
d3.rebind(chart, pie, 'valueFormat', 'values', 'x', 'y', 'description', 'id', 'showLabels', 'donutLabelsOutside', 'pieLabelsOutside', 'labelType', 'donut', 'donutRatio', 'labelThreshold');
chart.options = nv.utils.optionsFunc.bind(chart);
chart.margin = function(_) {
if (!arguments.length) return margin;
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;

@ -21,7 +21,7 @@ nv.models.pieChart = function() {
, state = {}
, defaultState = null
, noData = "No Data Available."
, dispatch = d3.dispatch('tooltipShow', 'tooltipHide', 'stateChange', 'changeState')
, dispatch = d3.dispatch('tooltipShow', 'tooltipHide', 'stateChange', 'changeState','renderEnd')
;
//============================================================
@ -41,10 +41,12 @@ nv.models.pieChart = function() {
nv.tooltip.show([left, top], content, e.value < 0 ? 'n' : 's', null, offsetElement);
};
var renderWatch = nv.utils.renderWatch(dispatch);
//============================================================
function chart(selection) {
renderWatch.reset();
selection.each(function(data) {
var container = d3.select(this),
that = this;
@ -185,6 +187,7 @@ nv.models.pieChart = function() {
});
renderWatch.renderEnd('pieChart immediate');
return chart;
}
@ -219,7 +222,7 @@ nv.models.pieChart = function() {
d3.rebind(chart, pie, 'valueFormat', 'values', 'x', 'y', 'description', 'id', 'showLabels', 'donutLabelsOutside', 'pieLabelsOutside', 'labelType', 'donut', 'donutRatio', 'labelThreshold');
chart.options = nv.utils.optionsFunc.bind(chart);
chart.margin = function(_) {
if (!arguments.length) return margin;
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;

Loading…
Cancel
Save