Use ColorPalette instead

This commit is contained in:
Hao Jiang
2018-02-22 08:44:39 +09:00
parent d583f6f273
commit a333abcaa5
2 changed files with 4 additions and 5 deletions

View File

@@ -1,6 +1,3 @@
@lightgrey: rgb(211, 211, 211);
@lightblue: rgb(135, 206, 250);
.funnel-visualization-container {
table {
max-width: 800px;
@@ -11,11 +8,9 @@
}
div.bar {
height: 30px;
background-color: @lightgrey;
}
div.bar.centered {
margin: auto;
background-color: @lightblue;
}
.value {
position: absolute;

View File

@@ -2,6 +2,7 @@ import { debounce, sortBy } from 'underscore';
import d3 from 'd3';
import angular from 'angular';
import { ColorPalette } from '@/visualizations/chart/plotly/utils';
import editorTemplate from './funnel-editor.html';
import './funnel.less';
@@ -46,6 +47,7 @@ function Funnel(scope, element) {
.style('min-width', '200px');
valContainers.append('div')
.attr('class', 'bar centered')
.style('background-color', ColorPalette.Cyan)
.style('width', d => d.pctTotal + '%');
valContainers.append('div')
.attr('class', 'value')
@@ -63,6 +65,8 @@ function Funnel(scope, element) {
.attr('class', 'container');
pctContainers.append('div')
.attr('class', 'bar')
.style('background-color', ColorPalette.Gray)
.style('opacity', '0.2')
.style('width', d => d.pctPrevious.toFixed(2) + '%');
pctContainers.append('div')
.attr('class', 'value')