|
|
@ -1503,6 +1503,9 @@ nv.models.cumulativeLineChart = function() {
|
|
|
|
, width = null
|
|
|
|
, width = null
|
|
|
|
, height = null
|
|
|
|
, height = null
|
|
|
|
, showLegend = true
|
|
|
|
, showLegend = true
|
|
|
|
|
|
|
|
, showXAxis = true
|
|
|
|
|
|
|
|
, showYAxis = true
|
|
|
|
|
|
|
|
, rightAlignYAxis = false
|
|
|
|
, tooltips = true
|
|
|
|
, tooltips = true
|
|
|
|
, showControls = true
|
|
|
|
, showControls = true
|
|
|
|
, rescaleY = true
|
|
|
|
, rescaleY = true
|
|
|
@ -1525,7 +1528,7 @@ nv.models.cumulativeLineChart = function() {
|
|
|
|
.tickPadding(7)
|
|
|
|
.tickPadding(7)
|
|
|
|
;
|
|
|
|
;
|
|
|
|
yAxis
|
|
|
|
yAxis
|
|
|
|
.orient('left')
|
|
|
|
.orient((rightAlignYAxis) ? 'right' : 'left')
|
|
|
|
;
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
//============================================================
|
|
|
|
//============================================================
|
|
|
@ -1764,6 +1767,10 @@ nv.models.cumulativeLineChart = function() {
|
|
|
|
|
|
|
|
|
|
|
|
wrap.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
|
|
|
|
wrap.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (rightAlignYAxis) {
|
|
|
|
|
|
|
|
g.select(".nv-y.nv-axis")
|
|
|
|
|
|
|
|
.attr("transform", "translate(" + availableWidth + ",0)");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Show error if series goes below 100%
|
|
|
|
// Show error if series goes below 100%
|
|
|
|
var tempDisabled = data.filter(function(d) { return d.tempDisabled });
|
|
|
|
var tempDisabled = data.filter(function(d) { return d.tempDisabled });
|
|
|
@ -1859,6 +1866,7 @@ nv.models.cumulativeLineChart = function() {
|
|
|
|
//------------------------------------------------------------
|
|
|
|
//------------------------------------------------------------
|
|
|
|
// Setup Axes
|
|
|
|
// Setup Axes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (showXAxis) {
|
|
|
|
xAxis
|
|
|
|
xAxis
|
|
|
|
.scale(x)
|
|
|
|
.scale(x)
|
|
|
|
//Suggest how many ticks based on the chart width and D3 should listen (70 is the optimal number for MM/DD/YY dates)
|
|
|
|
//Suggest how many ticks based on the chart width and D3 should listen (70 is the optimal number for MM/DD/YY dates)
|
|
|
@ -1869,8 +1877,10 @@ nv.models.cumulativeLineChart = function() {
|
|
|
|
.attr('transform', 'translate(0,' + y.range()[0] + ')');
|
|
|
|
.attr('transform', 'translate(0,' + y.range()[0] + ')');
|
|
|
|
d3.transition(g.select('.nv-x.nv-axis'))
|
|
|
|
d3.transition(g.select('.nv-x.nv-axis'))
|
|
|
|
.call(xAxis);
|
|
|
|
.call(xAxis);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (showYAxis) {
|
|
|
|
yAxis
|
|
|
|
yAxis
|
|
|
|
.scale(y)
|
|
|
|
.scale(y)
|
|
|
|
.ticks( availableHeight / 36 )
|
|
|
|
.ticks( availableHeight / 36 )
|
|
|
@ -1878,7 +1888,7 @@ nv.models.cumulativeLineChart = function() {
|
|
|
|
|
|
|
|
|
|
|
|
d3.transition(g.select('.nv-y.nv-axis'))
|
|
|
|
d3.transition(g.select('.nv-y.nv-axis'))
|
|
|
|
.call(yAxis);
|
|
|
|
.call(yAxis);
|
|
|
|
|
|
|
|
}
|
|
|
|
//------------------------------------------------------------
|
|
|
|
//------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2095,6 +2105,25 @@ nv.models.cumulativeLineChart = function() {
|
|
|
|
return chart;
|
|
|
|
return chart;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.showXAxis = function(_) {
|
|
|
|
|
|
|
|
if (!arguments.length) return showXAxis;
|
|
|
|
|
|
|
|
showXAxis = _;
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.showYAxis = function(_) {
|
|
|
|
|
|
|
|
if (!arguments.length) return showYAxis;
|
|
|
|
|
|
|
|
showYAxis = _;
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.rightAlignYAxis = function(_) {
|
|
|
|
|
|
|
|
if(!arguments.length) return rightAlignYAxis;
|
|
|
|
|
|
|
|
rightAlignYAxis = _;
|
|
|
|
|
|
|
|
yAxis.orient( (_) ? 'right' : 'left');
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
chart.tooltips = function(_) {
|
|
|
|
chart.tooltips = function(_) {
|
|
|
|
if (!arguments.length) return tooltips;
|
|
|
|
if (!arguments.length) return tooltips;
|
|
|
|
tooltips = _;
|
|
|
|
tooltips = _;
|
|
|
@ -2512,6 +2541,9 @@ nv.models.discreteBarChart = function() {
|
|
|
|
, width = null
|
|
|
|
, width = null
|
|
|
|
, height = null
|
|
|
|
, height = null
|
|
|
|
, color = nv.utils.getColor()
|
|
|
|
, color = nv.utils.getColor()
|
|
|
|
|
|
|
|
, showXAxis = true
|
|
|
|
|
|
|
|
, showYAxis = true
|
|
|
|
|
|
|
|
, rightAlignYAxis = false
|
|
|
|
, staggerLabels = false
|
|
|
|
, staggerLabels = false
|
|
|
|
, tooltips = true
|
|
|
|
, tooltips = true
|
|
|
|
, tooltip = function(key, x, y, e, graph) {
|
|
|
|
, tooltip = function(key, x, y, e, graph) {
|
|
|
@ -2531,7 +2563,7 @@ nv.models.discreteBarChart = function() {
|
|
|
|
.tickFormat(function(d) { return d })
|
|
|
|
.tickFormat(function(d) { return d })
|
|
|
|
;
|
|
|
|
;
|
|
|
|
yAxis
|
|
|
|
yAxis
|
|
|
|
.orient('left')
|
|
|
|
.orient((rightAlignYAxis) ? 'right' : 'left')
|
|
|
|
.tickFormat(d3.format(',.1f'))
|
|
|
|
.tickFormat(d3.format(',.1f'))
|
|
|
|
;
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
@ -2617,6 +2649,11 @@ nv.models.discreteBarChart = function() {
|
|
|
|
|
|
|
|
|
|
|
|
g.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
|
|
|
|
g.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (rightAlignYAxis) {
|
|
|
|
|
|
|
|
g.select(".nv-y.nv-axis")
|
|
|
|
|
|
|
|
.attr("transform", "translate(" + availableWidth + ",0)");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
//------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2650,6 +2687,7 @@ nv.models.discreteBarChart = function() {
|
|
|
|
//------------------------------------------------------------
|
|
|
|
//------------------------------------------------------------
|
|
|
|
// Setup Axes
|
|
|
|
// Setup Axes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (showXAxis) {
|
|
|
|
xAxis
|
|
|
|
xAxis
|
|
|
|
.scale(x)
|
|
|
|
.scale(x)
|
|
|
|
.ticks( availableWidth / 100 )
|
|
|
|
.ticks( availableWidth / 100 )
|
|
|
@ -2669,7 +2707,9 @@ nv.models.discreteBarChart = function() {
|
|
|
|
.selectAll('text')
|
|
|
|
.selectAll('text')
|
|
|
|
.attr('transform', function(d,i,j) { return 'translate(0,' + (j % 2 == 0 ? '5' : '17') + ')' })
|
|
|
|
.attr('transform', function(d,i,j) { return 'translate(0,' + (j % 2 == 0 ? '5' : '17') + ')' })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (showYAxis) {
|
|
|
|
yAxis
|
|
|
|
yAxis
|
|
|
|
.scale(y)
|
|
|
|
.scale(y)
|
|
|
|
.ticks( availableHeight / 36 )
|
|
|
|
.ticks( availableHeight / 36 )
|
|
|
@ -2677,6 +2717,7 @@ nv.models.discreteBarChart = function() {
|
|
|
|
|
|
|
|
|
|
|
|
d3.transition(g.select('.nv-y.nv-axis'))
|
|
|
|
d3.transition(g.select('.nv-y.nv-axis'))
|
|
|
|
.call(yAxis);
|
|
|
|
.call(yAxis);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
//------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
@ -2757,6 +2798,25 @@ nv.models.discreteBarChart = function() {
|
|
|
|
return chart;
|
|
|
|
return chart;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.showXAxis = function(_) {
|
|
|
|
|
|
|
|
if (!arguments.length) return showXAxis;
|
|
|
|
|
|
|
|
showXAxis = _;
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.showYAxis = function(_) {
|
|
|
|
|
|
|
|
if (!arguments.length) return showYAxis;
|
|
|
|
|
|
|
|
showYAxis = _;
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.rightAlignYAxis = function(_) {
|
|
|
|
|
|
|
|
if(!arguments.length) return rightAlignYAxis;
|
|
|
|
|
|
|
|
rightAlignYAxis = _;
|
|
|
|
|
|
|
|
yAxis.orient( (_) ? 'right' : 'left');
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
chart.staggerLabels = function(_) {
|
|
|
|
chart.staggerLabels = function(_) {
|
|
|
|
if (!arguments.length) return staggerLabels;
|
|
|
|
if (!arguments.length) return staggerLabels;
|
|
|
|
staggerLabels = _;
|
|
|
|
staggerLabels = _;
|
|
|
@ -7011,6 +7071,9 @@ nv.models.multiBarChart = function() {
|
|
|
|
, color = nv.utils.defaultColor()
|
|
|
|
, color = nv.utils.defaultColor()
|
|
|
|
, showControls = true
|
|
|
|
, showControls = true
|
|
|
|
, showLegend = true
|
|
|
|
, showLegend = true
|
|
|
|
|
|
|
|
, showXAxis = true
|
|
|
|
|
|
|
|
, showYAxis = true
|
|
|
|
|
|
|
|
, rightAlignYAxis = false
|
|
|
|
, reduceXTicks = true // if false a tick will show for every data point
|
|
|
|
, reduceXTicks = true // if false a tick will show for every data point
|
|
|
|
, staggerLabels = false
|
|
|
|
, staggerLabels = false
|
|
|
|
, rotateLabels = 0
|
|
|
|
, rotateLabels = 0
|
|
|
@ -7039,7 +7102,7 @@ nv.models.multiBarChart = function() {
|
|
|
|
.tickFormat(function(d) { return d })
|
|
|
|
.tickFormat(function(d) { return d })
|
|
|
|
;
|
|
|
|
;
|
|
|
|
yAxis
|
|
|
|
yAxis
|
|
|
|
.orient('left')
|
|
|
|
.orient((rightAlignYAxis) ? 'right' : 'left')
|
|
|
|
.tickFormat(d3.format(',.1f'))
|
|
|
|
.tickFormat(d3.format(',.1f'))
|
|
|
|
;
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
@ -7187,6 +7250,10 @@ nv.models.multiBarChart = function() {
|
|
|
|
|
|
|
|
|
|
|
|
wrap.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
|
|
|
|
wrap.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (rightAlignYAxis) {
|
|
|
|
|
|
|
|
g.select(".nv-y.nv-axis")
|
|
|
|
|
|
|
|
.attr("transform", "translate(" + availableWidth + ",0)");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
//------------------------------------------------------------
|
|
|
|
// Main Chart Component(s)
|
|
|
|
// Main Chart Component(s)
|
|
|
@ -7211,6 +7278,7 @@ nv.models.multiBarChart = function() {
|
|
|
|
//------------------------------------------------------------
|
|
|
|
//------------------------------------------------------------
|
|
|
|
// Setup Axes
|
|
|
|
// Setup Axes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (showXAxis) {
|
|
|
|
xAxis
|
|
|
|
xAxis
|
|
|
|
.scale(x)
|
|
|
|
.scale(x)
|
|
|
|
.ticks( availableWidth / 100 )
|
|
|
|
.ticks( availableWidth / 100 )
|
|
|
@ -7247,7 +7315,6 @@ nv.models.multiBarChart = function() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (reduceXTicks)
|
|
|
|
if (reduceXTicks)
|
|
|
|
xTicks
|
|
|
|
xTicks
|
|
|
|
.filter(function(d,i) {
|
|
|
|
.filter(function(d,i) {
|
|
|
@ -7264,7 +7331,10 @@ nv.models.multiBarChart = function() {
|
|
|
|
|
|
|
|
|
|
|
|
g.select('.nv-x.nv-axis').selectAll('g.nv-axisMaxMin text')
|
|
|
|
g.select('.nv-x.nv-axis').selectAll('g.nv-axisMaxMin text')
|
|
|
|
.style('opacity', 1);
|
|
|
|
.style('opacity', 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (showYAxis) {
|
|
|
|
yAxis
|
|
|
|
yAxis
|
|
|
|
.scale(y)
|
|
|
|
.scale(y)
|
|
|
|
.ticks( availableHeight / 36 )
|
|
|
|
.ticks( availableHeight / 36 )
|
|
|
@ -7272,6 +7342,7 @@ nv.models.multiBarChart = function() {
|
|
|
|
|
|
|
|
|
|
|
|
d3.transition(g.select('.nv-y.nv-axis'))
|
|
|
|
d3.transition(g.select('.nv-y.nv-axis'))
|
|
|
|
.call(yAxis);
|
|
|
|
.call(yAxis);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
//------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
@ -7438,6 +7509,25 @@ nv.models.multiBarChart = function() {
|
|
|
|
return chart;
|
|
|
|
return chart;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.showXAxis = function(_) {
|
|
|
|
|
|
|
|
if (!arguments.length) return showXAxis;
|
|
|
|
|
|
|
|
showXAxis = _;
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.showYAxis = function(_) {
|
|
|
|
|
|
|
|
if (!arguments.length) return showYAxis;
|
|
|
|
|
|
|
|
showYAxis = _;
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.rightAlignYAxis = function(_) {
|
|
|
|
|
|
|
|
if(!arguments.length) return rightAlignYAxis;
|
|
|
|
|
|
|
|
rightAlignYAxis = _;
|
|
|
|
|
|
|
|
yAxis.orient( (_) ? 'right' : 'left');
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
chart.reduceXTicks= function(_) {
|
|
|
|
chart.reduceXTicks= function(_) {
|
|
|
|
if (!arguments.length) return reduceXTicks;
|
|
|
|
if (!arguments.length) return reduceXTicks;
|
|
|
|
reduceXTicks = _;
|
|
|
|
reduceXTicks = _;
|
|
|
@ -10549,13 +10639,15 @@ nv.models.scatterChart = function() {
|
|
|
|
, showDistX = false
|
|
|
|
, showDistX = false
|
|
|
|
, showDistY = false
|
|
|
|
, showDistY = false
|
|
|
|
, showLegend = true
|
|
|
|
, showLegend = true
|
|
|
|
|
|
|
|
, showXAxis = true
|
|
|
|
|
|
|
|
, showYAxis = true
|
|
|
|
|
|
|
|
, rightAlignYAxis = false
|
|
|
|
, showControls = !!d3.fisheye
|
|
|
|
, showControls = !!d3.fisheye
|
|
|
|
, fisheye = 0
|
|
|
|
, fisheye = 0
|
|
|
|
, pauseFisheye = false
|
|
|
|
, pauseFisheye = false
|
|
|
|
, tooltips = true
|
|
|
|
, tooltips = true
|
|
|
|
, tooltipX = function(key, x, y) { return '<strong>' + x + '</strong>' }
|
|
|
|
, tooltipX = function(key, x, y) { return '<strong>' + x + '</strong>' }
|
|
|
|
, tooltipY = function(key, x, y) { return '<strong>' + y + '</strong>' }
|
|
|
|
, tooltipY = function(key, x, y) { return '<strong>' + y + '</strong>' }
|
|
|
|
//, tooltip = function(key, x, y) { return '<h3>' + key + '</h3>' }
|
|
|
|
|
|
|
|
, tooltip = null
|
|
|
|
, tooltip = null
|
|
|
|
, state = {}
|
|
|
|
, state = {}
|
|
|
|
, defaultState = null
|
|
|
|
, defaultState = null
|
|
|
@ -10572,7 +10664,7 @@ nv.models.scatterChart = function() {
|
|
|
|
.tickPadding(10)
|
|
|
|
.tickPadding(10)
|
|
|
|
;
|
|
|
|
;
|
|
|
|
yAxis
|
|
|
|
yAxis
|
|
|
|
.orient('left')
|
|
|
|
.orient((rightAlignYAxis) ? 'right' : 'left')
|
|
|
|
.tickPadding(10)
|
|
|
|
.tickPadding(10)
|
|
|
|
;
|
|
|
|
;
|
|
|
|
distX
|
|
|
|
distX
|
|
|
@ -10738,6 +10830,10 @@ nv.models.scatterChart = function() {
|
|
|
|
|
|
|
|
|
|
|
|
wrap.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
|
|
|
|
wrap.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (rightAlignYAxis) {
|
|
|
|
|
|
|
|
g.select(".nv-y.nv-axis")
|
|
|
|
|
|
|
|
.attr("transform", "translate(" + availableWidth + ",0)");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
//------------------------------------------------------------
|
|
|
|
// Main Chart Component(s)
|
|
|
|
// Main Chart Component(s)
|
|
|
@ -10776,7 +10872,7 @@ nv.models.scatterChart = function() {
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
//------------------------------------------------------------
|
|
|
|
// Setup Axes
|
|
|
|
// Setup Axes
|
|
|
|
|
|
|
|
if (showXAxis) {
|
|
|
|
xAxis
|
|
|
|
xAxis
|
|
|
|
.scale(x)
|
|
|
|
.scale(x)
|
|
|
|
.ticks( xAxis.ticks() && xAxis.ticks().length ? xAxis.ticks() : availableWidth / 100 )
|
|
|
|
.ticks( xAxis.ticks() && xAxis.ticks().length ? xAxis.ticks() : availableWidth / 100 )
|
|
|
@ -10786,7 +10882,9 @@ nv.models.scatterChart = function() {
|
|
|
|
.attr('transform', 'translate(0,' + y.range()[0] + ')')
|
|
|
|
.attr('transform', 'translate(0,' + y.range()[0] + ')')
|
|
|
|
.call(xAxis);
|
|
|
|
.call(xAxis);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (showYAxis) {
|
|
|
|
yAxis
|
|
|
|
yAxis
|
|
|
|
.scale(y)
|
|
|
|
.scale(y)
|
|
|
|
.ticks( yAxis.ticks() && yAxis.ticks().length ? yAxis.ticks() : availableHeight / 36 )
|
|
|
|
.ticks( yAxis.ticks() && yAxis.ticks().length ? yAxis.ticks() : availableHeight / 36 )
|
|
|
@ -10794,6 +10892,7 @@ nv.models.scatterChart = function() {
|
|
|
|
|
|
|
|
|
|
|
|
g.select('.nv-y.nv-axis')
|
|
|
|
g.select('.nv-y.nv-axis')
|
|
|
|
.call(yAxis);
|
|
|
|
.call(yAxis);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (showDistX) {
|
|
|
|
if (showDistX) {
|
|
|
@ -10823,7 +10922,8 @@ nv.models.scatterChart = function() {
|
|
|
|
gEnter.select('.nv-distWrap').append('g')
|
|
|
|
gEnter.select('.nv-distWrap').append('g')
|
|
|
|
.attr('class', 'nv-distributionY');
|
|
|
|
.attr('class', 'nv-distributionY');
|
|
|
|
g.select('.nv-distributionY')
|
|
|
|
g.select('.nv-distributionY')
|
|
|
|
.attr('transform', 'translate(-' + distY.size() + ',0)')
|
|
|
|
.attr('transform',
|
|
|
|
|
|
|
|
'translate(' + (rightAlignYAxis ? availableWidth : -distY.size() ) + ',0)')
|
|
|
|
.datum(data.filter(function(d) { return !d.disabled }))
|
|
|
|
.datum(data.filter(function(d) { return !d.disabled }))
|
|
|
|
.call(distY);
|
|
|
|
.call(distY);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -10861,8 +10961,12 @@ nv.models.scatterChart = function() {
|
|
|
|
g.select('.nv-scatterWrap')
|
|
|
|
g.select('.nv-scatterWrap')
|
|
|
|
.call(scatter);
|
|
|
|
.call(scatter);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (showXAxis)
|
|
|
|
g.select('.nv-x.nv-axis').call(xAxis);
|
|
|
|
g.select('.nv-x.nv-axis').call(xAxis);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (showYAxis)
|
|
|
|
g.select('.nv-y.nv-axis').call(yAxis);
|
|
|
|
g.select('.nv-y.nv-axis').call(yAxis);
|
|
|
|
|
|
|
|
|
|
|
|
g.select('.nv-distributionX')
|
|
|
|
g.select('.nv-distributionX')
|
|
|
|
.datum(data.filter(function(d) { return !d.disabled }))
|
|
|
|
.datum(data.filter(function(d) { return !d.disabled }))
|
|
|
|
.call(distX);
|
|
|
|
.call(distX);
|
|
|
@ -11071,6 +11175,26 @@ nv.models.scatterChart = function() {
|
|
|
|
return chart;
|
|
|
|
return chart;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.showXAxis = function(_) {
|
|
|
|
|
|
|
|
if (!arguments.length) return showXAxis;
|
|
|
|
|
|
|
|
showXAxis = _;
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.showYAxis = function(_) {
|
|
|
|
|
|
|
|
if (!arguments.length) return showYAxis;
|
|
|
|
|
|
|
|
showYAxis = _;
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.rightAlignYAxis = function(_) {
|
|
|
|
|
|
|
|
if(!arguments.length) return rightAlignYAxis;
|
|
|
|
|
|
|
|
rightAlignYAxis = _;
|
|
|
|
|
|
|
|
yAxis.orient( (_) ? 'right' : 'left');
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.fisheye = function(_) {
|
|
|
|
chart.fisheye = function(_) {
|
|
|
|
if (!arguments.length) return fisheye;
|
|
|
|
if (!arguments.length) return fisheye;
|
|
|
|
fisheye = _;
|
|
|
|
fisheye = _;
|
|
|
@ -11161,6 +11285,9 @@ nv.models.scatterPlusLineChart = function() {
|
|
|
|
, showDistX = false
|
|
|
|
, showDistX = false
|
|
|
|
, showDistY = false
|
|
|
|
, showDistY = false
|
|
|
|
, showLegend = true
|
|
|
|
, showLegend = true
|
|
|
|
|
|
|
|
, showXAxis = true
|
|
|
|
|
|
|
|
, showYAxis = true
|
|
|
|
|
|
|
|
, rightAlignYAxis = false
|
|
|
|
, showControls = !!d3.fisheye
|
|
|
|
, showControls = !!d3.fisheye
|
|
|
|
, fisheye = 0
|
|
|
|
, fisheye = 0
|
|
|
|
, pauseFisheye = false
|
|
|
|
, pauseFisheye = false
|
|
|
@ -11169,7 +11296,6 @@ nv.models.scatterPlusLineChart = function() {
|
|
|
|
, tooltipY = function(key, x, y) { return '<strong>' + y + '</strong>' }
|
|
|
|
, tooltipY = function(key, x, y) { return '<strong>' + y + '</strong>' }
|
|
|
|
, tooltip = function(key, x, y, date) { return '<h3>' + key + '</h3>'
|
|
|
|
, tooltip = function(key, x, y, date) { return '<h3>' + key + '</h3>'
|
|
|
|
+ '<p>' + date + '</p>' }
|
|
|
|
+ '<p>' + date + '</p>' }
|
|
|
|
//, tooltip = null
|
|
|
|
|
|
|
|
, state = {}
|
|
|
|
, state = {}
|
|
|
|
, defaultState = null
|
|
|
|
, defaultState = null
|
|
|
|
, dispatch = d3.dispatch('tooltipShow', 'tooltipHide', 'stateChange', 'changeState')
|
|
|
|
, dispatch = d3.dispatch('tooltipShow', 'tooltipHide', 'stateChange', 'changeState')
|
|
|
@ -11185,7 +11311,7 @@ nv.models.scatterPlusLineChart = function() {
|
|
|
|
.tickPadding(10)
|
|
|
|
.tickPadding(10)
|
|
|
|
;
|
|
|
|
;
|
|
|
|
yAxis
|
|
|
|
yAxis
|
|
|
|
.orient('left')
|
|
|
|
.orient((rightAlignYAxis) ? 'right' : 'left')
|
|
|
|
.tickPadding(10)
|
|
|
|
.tickPadding(10)
|
|
|
|
;
|
|
|
|
;
|
|
|
|
distX
|
|
|
|
distX
|
|
|
@ -11315,6 +11441,11 @@ nv.models.scatterPlusLineChart = function() {
|
|
|
|
|
|
|
|
|
|
|
|
wrap.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
|
|
|
|
wrap.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (rightAlignYAxis) {
|
|
|
|
|
|
|
|
g.select(".nv-y.nv-axis")
|
|
|
|
|
|
|
|
.attr("transform", "translate(" + availableWidth + ",0)");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
//------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -11399,6 +11530,7 @@ nv.models.scatterPlusLineChart = function() {
|
|
|
|
//------------------------------------------------------------
|
|
|
|
//------------------------------------------------------------
|
|
|
|
// Setup Axes
|
|
|
|
// Setup Axes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (showXAxis) {
|
|
|
|
xAxis
|
|
|
|
xAxis
|
|
|
|
.scale(x)
|
|
|
|
.scale(x)
|
|
|
|
.ticks( xAxis.ticks() ? xAxis.ticks() : availableWidth / 100 )
|
|
|
|
.ticks( xAxis.ticks() ? xAxis.ticks() : availableWidth / 100 )
|
|
|
@ -11407,8 +11539,9 @@ nv.models.scatterPlusLineChart = function() {
|
|
|
|
g.select('.nv-x.nv-axis')
|
|
|
|
g.select('.nv-x.nv-axis')
|
|
|
|
.attr('transform', 'translate(0,' + y.range()[0] + ')')
|
|
|
|
.attr('transform', 'translate(0,' + y.range()[0] + ')')
|
|
|
|
.call(xAxis);
|
|
|
|
.call(xAxis);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (showYAxis) {
|
|
|
|
yAxis
|
|
|
|
yAxis
|
|
|
|
.scale(y)
|
|
|
|
.scale(y)
|
|
|
|
.ticks( yAxis.ticks() ? yAxis.ticks() : availableHeight / 36 )
|
|
|
|
.ticks( yAxis.ticks() ? yAxis.ticks() : availableHeight / 36 )
|
|
|
@ -11416,6 +11549,7 @@ nv.models.scatterPlusLineChart = function() {
|
|
|
|
|
|
|
|
|
|
|
|
g.select('.nv-y.nv-axis')
|
|
|
|
g.select('.nv-y.nv-axis')
|
|
|
|
.call(yAxis);
|
|
|
|
.call(yAxis);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (showDistX) {
|
|
|
|
if (showDistX) {
|
|
|
@ -11445,7 +11579,7 @@ nv.models.scatterPlusLineChart = function() {
|
|
|
|
gEnter.select('.nv-distWrap').append('g')
|
|
|
|
gEnter.select('.nv-distWrap').append('g')
|
|
|
|
.attr('class', 'nv-distributionY');
|
|
|
|
.attr('class', 'nv-distributionY');
|
|
|
|
g.select('.nv-distributionY')
|
|
|
|
g.select('.nv-distributionY')
|
|
|
|
.attr('transform', 'translate(-' + distY.size() + ',0)')
|
|
|
|
.attr('transform', 'translate(' + (rightAlignYAxis ? availableWidth : -distY.size() ) + ',0)')
|
|
|
|
.datum(data.filter(function(d) { return !d.disabled }))
|
|
|
|
.datum(data.filter(function(d) { return !d.disabled }))
|
|
|
|
.call(distY);
|
|
|
|
.call(distY);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -11483,8 +11617,13 @@ nv.models.scatterPlusLineChart = function() {
|
|
|
|
g.select('.nv-scatterWrap')
|
|
|
|
g.select('.nv-scatterWrap')
|
|
|
|
.datum(data.filter(function(d) { return !d.disabled }))
|
|
|
|
.datum(data.filter(function(d) { return !d.disabled }))
|
|
|
|
.call(scatter);
|
|
|
|
.call(scatter);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (showXAxis)
|
|
|
|
g.select('.nv-x.nv-axis').call(xAxis);
|
|
|
|
g.select('.nv-x.nv-axis').call(xAxis);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (showYAxis)
|
|
|
|
g.select('.nv-y.nv-axis').call(yAxis);
|
|
|
|
g.select('.nv-y.nv-axis').call(yAxis);
|
|
|
|
|
|
|
|
|
|
|
|
g.select('.nv-distributionX')
|
|
|
|
g.select('.nv-distributionX')
|
|
|
|
.datum(data.filter(function(d) { return !d.disabled }))
|
|
|
|
.datum(data.filter(function(d) { return !d.disabled }))
|
|
|
|
.call(distX);
|
|
|
|
.call(distX);
|
|
|
@ -11693,6 +11832,25 @@ nv.models.scatterPlusLineChart = function() {
|
|
|
|
return chart;
|
|
|
|
return chart;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.showXAxis = function(_) {
|
|
|
|
|
|
|
|
if (!arguments.length) return showXAxis;
|
|
|
|
|
|
|
|
showXAxis = _;
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.showYAxis = function(_) {
|
|
|
|
|
|
|
|
if (!arguments.length) return showYAxis;
|
|
|
|
|
|
|
|
showYAxis = _;
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.rightAlignYAxis = function(_) {
|
|
|
|
|
|
|
|
if(!arguments.length) return rightAlignYAxis;
|
|
|
|
|
|
|
|
rightAlignYAxis = _;
|
|
|
|
|
|
|
|
yAxis.orient( (_) ? 'right' : 'left');
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
chart.fisheye = function(_) {
|
|
|
|
chart.fisheye = function(_) {
|
|
|
|
if (!arguments.length) return fisheye;
|
|
|
|
if (!arguments.length) return fisheye;
|
|
|
|
fisheye = _;
|
|
|
|
fisheye = _;
|
|
|
@ -12574,6 +12732,9 @@ nv.models.stackedAreaChart = function() {
|
|
|
|
, color = nv.utils.defaultColor() // a function that takes in d, i and returns color
|
|
|
|
, color = nv.utils.defaultColor() // a function that takes in d, i and returns color
|
|
|
|
, showControls = true
|
|
|
|
, showControls = true
|
|
|
|
, showLegend = true
|
|
|
|
, showLegend = true
|
|
|
|
|
|
|
|
, showXAxis = true
|
|
|
|
|
|
|
|
, showYAxis = true
|
|
|
|
|
|
|
|
, rightAlignYAxis = false
|
|
|
|
, tooltips = true
|
|
|
|
, tooltips = true
|
|
|
|
, tooltip = function(key, x, y, e, graph) {
|
|
|
|
, tooltip = function(key, x, y, e, graph) {
|
|
|
|
return '<h3>' + key + '</h3>' +
|
|
|
|
return '<h3>' + key + '</h3>' +
|
|
|
@ -12594,7 +12755,7 @@ nv.models.stackedAreaChart = function() {
|
|
|
|
.tickPadding(7)
|
|
|
|
.tickPadding(7)
|
|
|
|
;
|
|
|
|
;
|
|
|
|
yAxis
|
|
|
|
yAxis
|
|
|
|
.orient('left')
|
|
|
|
.orient((rightAlignYAxis) ? 'right' : 'left')
|
|
|
|
;
|
|
|
|
;
|
|
|
|
stacked.scatter
|
|
|
|
stacked.scatter
|
|
|
|
.pointActive(function(d) {
|
|
|
|
.pointActive(function(d) {
|
|
|
@ -12758,6 +12919,10 @@ nv.models.stackedAreaChart = function() {
|
|
|
|
|
|
|
|
|
|
|
|
wrap.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
|
|
|
|
wrap.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (rightAlignYAxis) {
|
|
|
|
|
|
|
|
g.select(".nv-y.nv-axis")
|
|
|
|
|
|
|
|
.attr("transform", "translate(" + availableWidth + ",0)");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
//------------------------------------------------------------
|
|
|
|
// Main Chart Component(s)
|
|
|
|
// Main Chart Component(s)
|
|
|
@ -12777,6 +12942,7 @@ nv.models.stackedAreaChart = function() {
|
|
|
|
//------------------------------------------------------------
|
|
|
|
//------------------------------------------------------------
|
|
|
|
// Setup Axes
|
|
|
|
// Setup Axes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (showXAxis) {
|
|
|
|
xAxis
|
|
|
|
xAxis
|
|
|
|
.scale(x)
|
|
|
|
.scale(x)
|
|
|
|
.ticks( availableWidth / 100 )
|
|
|
|
.ticks( availableWidth / 100 )
|
|
|
@ -12784,21 +12950,24 @@ nv.models.stackedAreaChart = function() {
|
|
|
|
|
|
|
|
|
|
|
|
g.select('.nv-x.nv-axis')
|
|
|
|
g.select('.nv-x.nv-axis')
|
|
|
|
.attr('transform', 'translate(0,' + availableHeight + ')');
|
|
|
|
.attr('transform', 'translate(0,' + availableHeight + ')');
|
|
|
|
//d3.transition(g.select('.nv-x.nv-axis'))
|
|
|
|
|
|
|
|
g.select('.nv-x.nv-axis')
|
|
|
|
g.select('.nv-x.nv-axis')
|
|
|
|
.transition().duration(0)
|
|
|
|
.transition().duration(0)
|
|
|
|
.call(xAxis);
|
|
|
|
.call(xAxis);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (showYAxis) {
|
|
|
|
yAxis
|
|
|
|
yAxis
|
|
|
|
.scale(y)
|
|
|
|
.scale(y)
|
|
|
|
.ticks(stacked.offset() == 'wiggle' ? 0 : availableHeight / 36)
|
|
|
|
.ticks(stacked.offset() == 'wiggle' ? 0 : availableHeight / 36)
|
|
|
|
.tickSize(-availableWidth, 0)
|
|
|
|
.tickSize(-availableWidth, 0)
|
|
|
|
.setTickFormat(stacked.offset() == 'expand' ? d3.format('%') : yAxisTickFormat);
|
|
|
|
.setTickFormat(stacked.offset() == 'expand' ? d3.format('%') : yAxisTickFormat);
|
|
|
|
|
|
|
|
|
|
|
|
//d3.transition(g.select('.nv-y.nv-axis'))
|
|
|
|
|
|
|
|
g.select('.nv-y.nv-axis')
|
|
|
|
g.select('.nv-y.nv-axis')
|
|
|
|
.transition().duration(0)
|
|
|
|
.transition().duration(0)
|
|
|
|
.call(yAxis);
|
|
|
|
.call(yAxis);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
//------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
@ -12996,6 +13165,25 @@ nv.models.stackedAreaChart = function() {
|
|
|
|
return chart;
|
|
|
|
return chart;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.showXAxis = function(_) {
|
|
|
|
|
|
|
|
if (!arguments.length) return showXAxis;
|
|
|
|
|
|
|
|
showXAxis = _;
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.showYAxis = function(_) {
|
|
|
|
|
|
|
|
if (!arguments.length) return showYAxis;
|
|
|
|
|
|
|
|
showYAxis = _;
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart.rightAlignYAxis = function(_) {
|
|
|
|
|
|
|
|
if(!arguments.length) return rightAlignYAxis;
|
|
|
|
|
|
|
|
rightAlignYAxis = _;
|
|
|
|
|
|
|
|
yAxis.orient( (_) ? 'right' : 'left');
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
chart.tooltip = function(_) {
|
|
|
|
chart.tooltip = function(_) {
|
|
|
|
if (!arguments.length) return tooltip;
|
|
|
|
if (!arguments.length) return tooltip;
|
|
|
|
tooltip = _;
|
|
|
|
tooltip = _;
|
|
|
|