Browse Source

feat: remove depth for percentage chart

pull/347/head
Shivam Mishra 4 years ago
parent
commit
846a21ae6a
3 changed files with 3 additions and 7 deletions
  1. +1
    -3
      src/js/charts/PercentageChart.js
  2. +1
    -2
      src/js/utils/constants.js
  3. +1
    -2
      src/js/utils/draw.js

+ 1
- 3
src/js/charts/PercentageChart.js View File

@@ -1,7 +1,7 @@
import AggregationChart from './AggregationChart'; import AggregationChart from './AggregationChart';
import { getOffset } from '../utils/dom'; import { getOffset } from '../utils/dom';
import { getComponent } from '../objects/ChartComponents'; import { getComponent } from '../objects/ChartComponents';
import { PERCENTAGE_BAR_DEFAULT_HEIGHT, PERCENTAGE_BAR_DEFAULT_DEPTH } from '../utils/constants';
import { PERCENTAGE_BAR_DEFAULT_HEIGHT } from '../utils/constants';


export default class PercentageChart extends AggregationChart { export default class PercentageChart extends AggregationChart {
constructor(parent, args) { constructor(parent, args) {
@@ -16,7 +16,6 @@ export default class PercentageChart extends AggregationChart {


let b = this.barOptions; let b = this.barOptions;
b.height = b.height || PERCENTAGE_BAR_DEFAULT_HEIGHT; b.height = b.height || PERCENTAGE_BAR_DEFAULT_HEIGHT;
b.depth = b.depth || PERCENTAGE_BAR_DEFAULT_DEPTH;


m.paddings.right = 30; m.paddings.right = 30;
m.legendHeight = 60; m.legendHeight = 60;
@@ -31,7 +30,6 @@ export default class PercentageChart extends AggregationChart {
'percentageBars', 'percentageBars',
{ {
barHeight: this.barOptions.height, barHeight: this.barOptions.height,
barDepth: this.barOptions.depth,
}, },
function() { function() {
return { return {


+ 1
- 2
src/js/utils/constants.js View File

@@ -73,8 +73,7 @@ export const MIN_BAR_PERCENT_HEIGHT = 0.00;
export const LINE_CHART_DOT_SIZE = 4; export const LINE_CHART_DOT_SIZE = 4;
export const DOT_OVERLAY_SIZE_INCR = 4; export const DOT_OVERLAY_SIZE_INCR = 4;


export const PERCENTAGE_BAR_DEFAULT_HEIGHT = 20;
export const PERCENTAGE_BAR_DEFAULT_DEPTH = 2;
export const PERCENTAGE_BAR_DEFAULT_HEIGHT = 16;


// Fixed 5-color theme, // Fixed 5-color theme,
// More colors are difficult to parse visually // More colors are difficult to parse visually


+ 1
- 2
src/js/utils/draw.js View File

@@ -1,7 +1,6 @@
import { getBarHeightAndYAttr, truncateString, shortenLargeNumber, getSplineCurvePointsStr } from './draw-utils'; import { getBarHeightAndYAttr, truncateString, shortenLargeNumber, getSplineCurvePointsStr } from './draw-utils';
import { getStringWidth, isValidNumber } from './helpers'; import { getStringWidth, isValidNumber } from './helpers';
import { DOT_OVERLAY_SIZE_INCR, PERCENTAGE_BAR_DEFAULT_DEPTH } from './constants';
import { lightenDarkenColor } from './colors';
import { DOT_OVERLAY_SIZE_INCR } from './constants';


export const AXIS_TICK_LENGTH = 6; export const AXIS_TICK_LENGTH = 6;
const LABEL_MARGIN = 4; const LABEL_MARGIN = 4;


Loading…
Cancel
Save