Issue #273 sparkline can now have custom color

master-patched
Bob Monteverde 12 years ago
parent c6a24216ec
commit 01f9afa8de

@ -9569,7 +9569,6 @@ nv.models.sparklinePlus = function() {
, height = null , height = null
, x , x
, y , y
, color = nv.utils.defaultColor()
, index , index
, paused = false , paused = false
, xTickFormat = d3.format(',r') , xTickFormat = d3.format(',r')
@ -9654,7 +9653,6 @@ nv.models.sparklinePlus = function() {
.height(availableHeight); .height(availableHeight);
sparklineWrap sparklineWrap
.style('stroke', function(d, i){ return d.color || color(d, i) })
.call(sparkline); .call(sparkline);
//------------------------------------------------------------ //------------------------------------------------------------
@ -9760,7 +9758,7 @@ nv.models.sparklinePlus = function() {
// expose chart's sub-components // expose chart's sub-components
chart.sparkline = sparkline; chart.sparkline = sparkline;
d3.rebind(chart, sparkline, 'x', 'y', 'xScale', 'yScale'); d3.rebind(chart, sparkline, 'x', 'y', 'xScale', 'yScale', 'color');
chart.margin = function(_) { chart.margin = function(_) {
if (!arguments.length) return margin; if (!arguments.length) return margin;

4
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

@ -12,7 +12,6 @@ nv.models.sparklinePlus = function() {
, height = null , height = null
, x , x
, y , y
, color = nv.utils.defaultColor()
, index , index
, paused = false , paused = false
, xTickFormat = d3.format(',r') , xTickFormat = d3.format(',r')
@ -97,7 +96,6 @@ nv.models.sparklinePlus = function() {
.height(availableHeight); .height(availableHeight);
sparklineWrap sparklineWrap
.style('stroke', function(d, i){ return d.color || color(d, i) })
.call(sparkline); .call(sparkline);
//------------------------------------------------------------ //------------------------------------------------------------
@ -203,7 +201,7 @@ nv.models.sparklinePlus = function() {
// expose chart's sub-components // expose chart's sub-components
chart.sparkline = sparkline; chart.sparkline = sparkline;
d3.rebind(chart, sparkline, 'x', 'y', 'xScale', 'yScale'); d3.rebind(chart, sparkline, 'x', 'y', 'xScale', 'yScale', 'color');
chart.margin = function(_) { chart.margin = function(_) {
if (!arguments.length) return margin; if (!arguments.length) return margin;

Loading…
Cancel
Save