fix to previous fix

master
Tyler Wolf 11 years ago
parent caa6b56c73
commit cfc706bfa9

@ -13597,6 +13597,7 @@ nv.models.stackedAreaChart = function() {
, noData = 'No Data Available.'
, dispatch = d3.dispatch('tooltipShow', 'tooltipHide', 'stateChange', 'changeState')
, controlWidth = 250
, controlsData = ['Stacked','Stream','Expanded']
;
xAxis
@ -13738,6 +13739,10 @@ nv.models.stackedAreaChart = function() {
{ key: 'Expanded', disabled: stacked.offset() != 'expand' }
];
controlsData = controlsData.filter(function(d) {
return cData.indexOf(d.key) > -1;
})
controls
.width( controlWidth )
.color(['#444', '#444', '#444']);
@ -13819,7 +13824,6 @@ nv.models.stackedAreaChart = function() {
.tickSize(-availableWidth, 0)
.setTickFormat(stacked.offset() == 'expand' ? d3.format('%') : yAxisTickFormat);
g.select('.nv-y.nv-axis')
.transition().duration(0)
.call(yAxis);
@ -14119,6 +14123,12 @@ nv.models.stackedAreaChart = function() {
return chart;
};
chart.controlsData = function(_) {
if (!arguments.length) return cData;
cData = _;
return chart;
};
yAxis.setTickFormat = yAxis.tickFormat;
yAxis.tickFormat = function(_) {

14
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

@ -36,6 +36,7 @@ nv.models.stackedAreaChart = function() {
, noData = 'No Data Available.'
, dispatch = d3.dispatch('tooltipShow', 'tooltipHide', 'stateChange', 'changeState')
, controlWidth = 250
, controlsData = ['Stacked','Stream','Expanded']
;
xAxis
@ -177,6 +178,10 @@ nv.models.stackedAreaChart = function() {
{ key: 'Expanded', disabled: stacked.offset() != 'expand' }
];
controlsData = controlsData.filter(function(d) {
return cData.indexOf(d.key) > -1;
})
controls
.width( controlWidth )
.color(['#444', '#444', '#444']);
@ -258,7 +263,6 @@ nv.models.stackedAreaChart = function() {
.tickSize(-availableWidth, 0)
.setTickFormat(stacked.offset() == 'expand' ? d3.format('%') : yAxisTickFormat);
g.select('.nv-y.nv-axis')
.transition().duration(0)
.call(yAxis);
@ -558,6 +562,12 @@ nv.models.stackedAreaChart = function() {
return chart;
};
chart.controlsData = function(_) {
if (!arguments.length) return cData;
cData = _;
return chart;
};
yAxis.setTickFormat = yAxis.tickFormat;
yAxis.tickFormat = function(_) {

Loading…
Cancel
Save