Clean up lineWithFocus a little more to be consistent with other charts

master-patched
Bob Monteverde 12 years ago
parent 389a926dff
commit c109150965

@ -4118,6 +4118,7 @@ nv.models.lineWithFocusChart = function() {
, x2Axis = nv.models.axis()
, y2Axis = nv.models.axis()
, legend = nv.models.legend()
, brush = d3.svg.brush()
;
var margin = {top: 30, right: 30, bottom: 30, left: 60}
@ -4126,6 +4127,10 @@ nv.models.lineWithFocusChart = function() {
, width = null
, height = null
, height2 = 100
, x
, y
, x2
, y2
, showLegend = true
, brushExtent = null
, tooltips = true
@ -4137,12 +4142,6 @@ nv.models.lineWithFocusChart = function() {
, dispatch = d3.dispatch('tooltipShow', 'tooltipHide')
;
var x = lines.xScale(),
y = lines.yScale(),
x2 = lines2.xScale(),
y2 = lines2.yScale(),
brush = d3.svg.brush().x(x2);
lines
.clipEdge(true)
;
@ -4214,8 +4213,15 @@ nv.models.lineWithFocusChart = function() {
//------------------------------------------------------------
//------------------------------------------------------------
// Setup Scales
brush.on('brush', onBrush);
x = lines.xScale();
y = lines.yScale();
x2 = lines2.xScale();
y2 = lines2.yScale();
//------------------------------------------------------------
//------------------------------------------------------------
@ -4339,6 +4345,10 @@ nv.models.lineWithFocusChart = function() {
//------------------------------------------------------------
// Setup Brush
brush
.x(x2)
.on('brush', onBrush);
if (brushExtent) brush.extent(brushExtent);
var brushBG = g.select('.nv-brushBackground').selectAll('g')

6
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

@ -12,6 +12,7 @@ nv.models.lineWithFocusChart = function() {
, x2Axis = nv.models.axis()
, y2Axis = nv.models.axis()
, legend = nv.models.legend()
, brush = d3.svg.brush()
;
var margin = {top: 30, right: 30, bottom: 30, left: 60}
@ -20,6 +21,10 @@ nv.models.lineWithFocusChart = function() {
, width = null
, height = null
, height2 = 100
, x
, y
, x2
, y2
, showLegend = true
, brushExtent = null
, tooltips = true
@ -31,12 +36,6 @@ nv.models.lineWithFocusChart = function() {
, dispatch = d3.dispatch('tooltipShow', 'tooltipHide')
;
var x = lines.xScale(),
y = lines.yScale(),
x2 = lines2.xScale(),
y2 = lines2.yScale(),
brush = d3.svg.brush().x(x2);
lines
.clipEdge(true)
;
@ -108,8 +107,15 @@ nv.models.lineWithFocusChart = function() {
//------------------------------------------------------------
//------------------------------------------------------------
// Setup Scales
brush.on('brush', onBrush);
x = lines.xScale();
y = lines.yScale();
x2 = lines2.xScale();
y2 = lines2.yScale();
//------------------------------------------------------------
//------------------------------------------------------------
@ -233,6 +239,10 @@ nv.models.lineWithFocusChart = function() {
//------------------------------------------------------------
// Setup Brush
brush
.x(x2)
.on('brush', onBrush);
if (brushExtent) brush.extent(brushExtent);
var brushBG = g.select('.nv-brushBackground').selectAll('g')

Loading…
Cancel
Save