Skip to content

Commit

Permalink
HUE-427. Allow the stroke color of dots on HueChart.Line to be config…
Browse files Browse the repository at this point in the history
…urable

* Also setting tips delay to zero.
  • Loading branch information
anutron committed Feb 7, 2011
1 parent 0469d6f commit a5c488d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
5 changes: 5 additions & 0 deletions desktop/core/static/js/Source/Hue/HueChart.Box.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ var getXValueFn = function(field) {
HueChart.Tips = new Class({
Extends: Tips,

options: {
showDelay: 0,
hideDelay: 0
},

show: function(element, actualShow) {
if (actualShow) this.parent(element);
}
Expand Down
17 changes: 11 additions & 6 deletions desktop/core/static/js/Source/Hue/HueChart.Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ HueChart.Line = new Class({

options: {
lineWidth: 3, //Width of the lines in the chart
showDot: false //Show a dot on each point of the line
dot: {
strokeColor: '#fff', //the color of the line around the dot at each data point
size: 0
}
},

initialize: function(element, options) {
Expand All @@ -40,7 +43,7 @@ HueChart.Line = new Class({
var series = this.series[itemIndex];
var dataSeries = this.getData(true).getDataSeries(series);
//Add a line to the visualization, connecting points produced from the data object.
vis.add(pv.Line)
var visLine = vis.add(pv.Line)
//Using as data, this.data.getObjects.
.data($lambda(dataSeries))
//Closures used because the function argument isn't executed until the render phase.
Expand All @@ -60,16 +63,18 @@ HueChart.Line = new Class({
}.bind(this);
}.bind(this)(itemIndex))
//Make the line's width 3 pixels.
.lineWidth(this.options.lineWidth)
.add(pv.Dot)
.strokeStyle('white')
.lineWidth(this.options.lineWidth);
if (this.options.dot.size) {
visLine.add(pv.Dot)
.strokeStyle(this.options.dot.strokeColor)
.fillStyle(function(itemIndex) {
return function() {
return this.getColor(this.series[itemIndex]);
}.bind(this);
}.bind(this)(itemIndex))
.size(this.options.showDot ? 5 : 0)
.size(this.options.dot.size)
.lineWidth(1);
}
}
}
});
Expand Down

0 comments on commit a5c488d

Please sign in to comment.