|
|
@ -1,5 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
nv.models.lineWithLegend = function() {
|
|
|
|
nv.models.lineChart = function() {
|
|
|
|
var margin = {top: 30, right: 20, bottom: 50, left: 60},
|
|
|
|
var margin = {top: 30, right: 20, bottom: 50, left: 60},
|
|
|
|
color = d3.scale.category20().range(),
|
|
|
|
color = d3.scale.category20().range(),
|
|
|
|
width = null,
|
|
|
|
width = null,
|
|
|
@ -86,8 +86,7 @@ nv.models.lineWithLegend = function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
xAxis
|
|
|
|
xAxis
|
|
|
|
.domain(x.domain())
|
|
|
|
.scale(x)
|
|
|
|
.range(x.range())
|
|
|
|
|
|
|
|
.ticks( availableWidth / 100 )
|
|
|
|
.ticks( availableWidth / 100 )
|
|
|
|
.tickSize(-availableHeight, 0);
|
|
|
|
.tickSize(-availableHeight, 0);
|
|
|
|
|
|
|
|
|
|
|
@ -98,8 +97,7 @@ nv.models.lineWithLegend = function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yAxis
|
|
|
|
yAxis
|
|
|
|
.domain(y.domain())
|
|
|
|
.scale(y)
|
|
|
|
.range(y.range())
|
|
|
|
|
|
|
|
.ticks( availableHeight / 36 )
|
|
|
|
.ticks( availableHeight / 36 )
|
|
|
|
.tickSize( -availableWidth, 0);
|
|
|
|
.tickSize( -availableWidth, 0);
|
|
|
|
|
|
|
|
|
|
|
@ -137,13 +135,8 @@ nv.models.lineWithLegend = function() {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
lines.dispatch.on('elementMouseover.tooltip', function(e) {
|
|
|
|
lines.dispatch.on('elementMouseover.tooltip', function(e) {
|
|
|
|
dispatch.tooltipShow({
|
|
|
|
e.pos = [e.pos[0] + margin.left, e.pos[1] + margin.top];
|
|
|
|
point: e.point,
|
|
|
|
dispatch.tooltipShow(e);
|
|
|
|
series: e.series,
|
|
|
|
|
|
|
|
pos: [e.pos[0] + margin.left, e.pos[1] + margin.top],
|
|
|
|
|
|
|
|
seriesIndex: e.seriesIndex,
|
|
|
|
|
|
|
|
pointIndex: e.pointIndex
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
dispatch.on('tooltipShow', function(e) { showTooltip(e, this) } ); // TODO: maybe merge with above?
|
|
|
|
dispatch.on('tooltipShow', function(e) { showTooltip(e, this) } ); // TODO: maybe merge with above?
|
|
|
|
|
|
|
|
|
|
|
|