Sfoglia il codice sorgente

feat: allow custom yRegion colors

pull/347/head
Shivam Mishra 4 anni fa
parent
commit
8524e6cbd6
2 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. +1
    -1
      src/js/objects/ChartComponents.js
  2. +2
    -2
      src/js/utils/draw.js

+ 1
- 1
src/js/objects/ChartComponents.js Vedi File

@@ -220,7 +220,7 @@ let componentConfigs = {
makeElements(data) {
return data.map(r =>
yRegion(r.startPos, r.endPos, this.constants.width,
r.label, { labelPos: r.options.labelPos })
r.label, { labelPos: r.options.labelPos, stroke: r.options.stroke, fill: r.options.fill })
);
},
animateElements(newData) {


+ 2
- 2
src/js/utils/draw.js Vedi File

@@ -465,8 +465,8 @@ export function yRegion(y1, y2, width, label, options = {}) {
let rect = createSVG('rect', {
className: `bar mini`, // remove class
styles: {
fill: `rgba(228, 234, 239, 0.49)`,
stroke: BASE_LINE_COLOR,
fill: options.fill || `rgba(228, 234, 239, 0.49)`,
stroke: options.stroke || BASE_LINE_COLOR,
'stroke-dasharray': `${width}, ${height}`
},
// 'data-point-index': index,


Caricamento…
Annulla
Salva