return d.measures[widget.sizeMetric].val;
};
- this.fm = function(value, name) {
- var type = this.metrics()[name].type;
-
- switch (type) {
- case 'FLOAT':
- return d3.format('.1f')(value);
- case 'INT':
- return d3.format('d')(value);
- default :
- return value;
- }
- };
-
// Configure scales
this
widget.infoDate.text(d.longName);
var metricLines = [
- { metric: widget.metrics()[widget.xMetric].name, value: widget.fm(widget.getXMetric(d), widget.xMetric) },
- { metric: widget.metrics()[widget.yMetric].name, value: widget.fm(widget.getYMetric(d), widget.yMetric) },
- { metric: widget.metrics()[widget.sizeMetric].name, value: widget.fm(widget.getSizeMetric(d), widget.sizeMetric) }
+ { metric: widget.metrics()[widget.xMetric].name, value: d.measures[widget.xMetric].fval },
+ { metric: widget.metrics()[widget.yMetric].name, value: d.measures[widget.yMetric].fval },
+ { metric: widget.metrics()[widget.sizeMetric].name, value: d.measures[widget.sizeMetric].fval }
];
var lastX = 0;
return 0;
}
};
- this.fm = function(value, name) {
- var type = this.metrics()[name].type;
-
- switch (type) {
- case 'FLOAT':
- return d3.format('.1f')(value);
- case 'INT':
- return d3.format('d')(value);
- default :
- return value;
- }
- };
// Configure scales
.append('text')
.classed('legend-text value', true)
.attr('dy', '-0.35em')
- .text(function(d) { return widget.fm(widget.getMainMetric(d), widget.mainMetric); })
+ .text(function(d) { return d.measures[widget.mainMetric].fval; })
.attr('transform', function(d) { return trans(widget.legendWidth() + widget.x(widget.getMainMetric(d)) + 5, barHeight); });
this.bars.selectAll('rect')
return 0;
}
};
- this.fm = function(value, name) {
- var type = this.metrics()[name].type;
-
- switch (type) {
- case 'FLOAT':
- return d3.format('.1f')(value);
- case 'INT':
- return d3.format('d')(value);
- default :
- return value;
- }
- };
// Configure scales
var metrics = widget.metricsPriority().map(function(m) {
return {
name: widget.metrics()[m].name,
- value: widget.fm(d.measures[m].val, m)
+ value: d.measures[m].fval
};
});
metrics.unshift({ name: d.name });
}
widget.donutLabel
.style('opacity', 1)
- .text(widget.fm(widget.getMainMetric(d), widget.mainMetric));
+ .text(d.measures[widget.mainMetric].fval);
widget.donutLabel
.style('opacity', 1);
widget.donutLabel2