[table viz] get metrics to right-align (#2943)

Moved the histogram to be rooted on the right side as well

fixes https://github.com/airbnb/superset/issues/2933
This commit is contained in:
Maxime Beauchemin 2017-06-12 13:35:00 -07:00 committed by GitHub
parent 1eff48facb
commit 0d2c2b0681

View File

@ -94,12 +94,13 @@ function tableVis(slice, payload) {
// The 0.01 to 0.001 is a workaround for what appears to be a
// CSS rendering bug on flat, transparent colors
return (
`linear-gradient(to right, rgba(0,0,0,0.2), rgba(0,0,0,0.2) ${perc}%, ` +
`linear-gradient(to left, rgba(0,0,0,0.2), rgba(0,0,0,0.2) ${perc}%, ` +
`rgba(0,0,0,0.01) ${perc}%, rgba(0,0,0,0.001) 100%)`
);
}
return null;
})
.classed('text-right', d => d.isMetric)
.attr('title', (d) => {
if (!isNaN(d.val)) {
return fC(d.val);