|
|
@@ -1,4 +1,4 @@ |
|
|
|
import { getBarHeightAndYAttr, truncateString } from './draw-utils'; |
|
|
|
import { getBarHeightAndYAttr, truncateString, shortenLargeNumber } from './draw-utils'; |
|
|
|
import { getStringWidth } from './helpers'; |
|
|
|
import { DOT_OVERLAY_SIZE_INCR, PERCENTAGE_BAR_DEFAULT_DEPTH } from './constants'; |
|
|
|
import { lightenDarkenColor } from './colors'; |
|
|
@@ -319,6 +319,8 @@ function makeVertLine(x, label, y1, y2, options={}) { |
|
|
|
function makeHoriLine(y, label, x1, x2, options={}) { |
|
|
|
if(!options.stroke) options.stroke = BASE_LINE_COLOR; |
|
|
|
if(!options.lineType) options.lineType = ''; |
|
|
|
if (options.shortenNumbers) label = shortenLargeNumber(label) |
|
|
|
|
|
|
|
let className = 'line-horizontal ' + options.className + |
|
|
|
(options.lineType === "dashed" ? "dashed": ""); |
|
|
|
|
|
|
@@ -380,7 +382,8 @@ export function yLine(y, label, width, options={}) { |
|
|
|
return makeHoriLine(y, label, x1, x2, { |
|
|
|
stroke: options.stroke, |
|
|
|
className: options.className, |
|
|
|
lineType: options.lineType |
|
|
|
lineType: options.lineType, |
|
|
|
shortenNumbers: options.shortenNumbers |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|