@dhis2/analytics 26.0.20 → 26.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/chart.js +1 -1
- package/build/cjs/visualizations/config/generators/highcharts/index.js +5 -4
- package/build/es/visualizations/config/adapters/dhis_highcharts/chart.js +1 -1
- package/build/es/visualizations/config/generators/highcharts/index.js +5 -4
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@ const getEvents = () => ({
|
|
|
25
25
|
this.legend.allItems.forEach(item => {
|
|
26
26
|
if (item.legendSymbol) {
|
|
27
27
|
item.legendSymbol.attr({
|
|
28
|
-
translateY: -(item.legendItem.getBBox().height * 0.75 / 4) + item.legendSymbol.r / 2
|
|
28
|
+
translateY: -(item.legendItem.label.getBBox().height * 0.75 / 4) + item.legendSymbol.r / 2
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
});
|
|
@@ -23,6 +23,7 @@ function drawLegendSymbolWrap() {
|
|
|
23
23
|
const pick = _highcharts.default.pick;
|
|
24
24
|
_highcharts.default.wrap(_highcharts.default.seriesTypes.column.prototype, 'drawLegendSymbol', function (proceed, legend, item) {
|
|
25
25
|
var _this$options$legendS, _this$options$legendS2;
|
|
26
|
+
const legendItem = item.legendItem;
|
|
26
27
|
if ((_this$options$legendS = this.options.legendSet) !== null && _this$options$legendS !== void 0 && (_this$options$legendS2 = _this$options$legendS.legends) !== null && _this$options$legendS2 !== void 0 && _this$options$legendS2.length) {
|
|
27
28
|
const ys = legend.baseline - legend.symbolHeight + 1,
|
|
28
29
|
// y start
|
|
@@ -32,18 +33,18 @@ function drawLegendSymbolWrap() {
|
|
|
32
33
|
const legends = this.options.legendSet.legends.sort((a, b) => a.startValue - b.startValue);
|
|
33
34
|
this.chart.renderer.path(['M', x, ys, 'A', 1, 1, 0, 0, 0, x, ye, 'V', ys]).attr({
|
|
34
35
|
fill: legends[legends.length >= 5 ? 1 : 0].color
|
|
35
|
-
}).add(
|
|
36
|
+
}).add(legendItem.group);
|
|
36
37
|
this.chart.renderer.path(['M', x, ye, 'A', 1, 1, 0, 0, 0, x, ys, 'V', ye]).attr({
|
|
37
38
|
fill: legends[legends.length >= 5 ? legends.length - 2 : legends.length - 1].color
|
|
38
|
-
}).add(
|
|
39
|
+
}).add(legendItem.group);
|
|
39
40
|
} else {
|
|
40
41
|
var options = legend.options,
|
|
41
42
|
symbolHeight = legend.symbolHeight,
|
|
42
43
|
square = options.squareSymbol,
|
|
43
44
|
symbolWidth = square ? symbolHeight : legend.symbolWidth;
|
|
44
|
-
|
|
45
|
+
legendItem.symbol = this.chart.renderer.rect(square ? (legend.symbolWidth - symbolHeight) / 2 : 0, legend.baseline - symbolHeight + 1, symbolWidth, symbolHeight, pick(legend.options.symbolRadius, symbolHeight / 2)).addClass('highcharts-point').attr({
|
|
45
46
|
zIndex: 3
|
|
46
|
-
}).add(
|
|
47
|
+
}).add(legendItem.group);
|
|
47
48
|
}
|
|
48
49
|
});
|
|
49
50
|
}
|
|
@@ -18,7 +18,7 @@ const getEvents = () => ({
|
|
|
18
18
|
this.legend.allItems.forEach(item => {
|
|
19
19
|
if (item.legendSymbol) {
|
|
20
20
|
item.legendSymbol.attr({
|
|
21
|
-
translateY: -(item.legendItem.getBBox().height * 0.75 / 4) + item.legendSymbol.r / 2
|
|
21
|
+
translateY: -(item.legendItem.label.getBBox().height * 0.75 / 4) + item.legendSymbol.r / 2
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
});
|
|
@@ -17,6 +17,7 @@ function drawLegendSymbolWrap() {
|
|
|
17
17
|
const pick = H.pick;
|
|
18
18
|
H.wrap(H.seriesTypes.column.prototype, 'drawLegendSymbol', function (proceed, legend, item) {
|
|
19
19
|
var _this$options$legendS, _this$options$legendS2;
|
|
20
|
+
const legendItem = item.legendItem;
|
|
20
21
|
if ((_this$options$legendS = this.options.legendSet) !== null && _this$options$legendS !== void 0 && (_this$options$legendS2 = _this$options$legendS.legends) !== null && _this$options$legendS2 !== void 0 && _this$options$legendS2.length) {
|
|
21
22
|
const ys = legend.baseline - legend.symbolHeight + 1,
|
|
22
23
|
// y start
|
|
@@ -26,18 +27,18 @@ function drawLegendSymbolWrap() {
|
|
|
26
27
|
const legends = this.options.legendSet.legends.sort((a, b) => a.startValue - b.startValue);
|
|
27
28
|
this.chart.renderer.path(['M', x, ys, 'A', 1, 1, 0, 0, 0, x, ye, 'V', ys]).attr({
|
|
28
29
|
fill: legends[legends.length >= 5 ? 1 : 0].color
|
|
29
|
-
}).add(
|
|
30
|
+
}).add(legendItem.group);
|
|
30
31
|
this.chart.renderer.path(['M', x, ye, 'A', 1, 1, 0, 0, 0, x, ys, 'V', ye]).attr({
|
|
31
32
|
fill: legends[legends.length >= 5 ? legends.length - 2 : legends.length - 1].color
|
|
32
|
-
}).add(
|
|
33
|
+
}).add(legendItem.group);
|
|
33
34
|
} else {
|
|
34
35
|
var options = legend.options,
|
|
35
36
|
symbolHeight = legend.symbolHeight,
|
|
36
37
|
square = options.squareSymbol,
|
|
37
38
|
symbolWidth = square ? symbolHeight : legend.symbolWidth;
|
|
38
|
-
|
|
39
|
+
legendItem.symbol = this.chart.renderer.rect(square ? (legend.symbolWidth - symbolHeight) / 2 : 0, legend.baseline - symbolHeight + 1, symbolWidth, symbolHeight, pick(legend.options.symbolRadius, symbolHeight / 2)).addClass('highcharts-point').attr({
|
|
39
40
|
zIndex: 3
|
|
40
|
-
}).add(
|
|
41
|
+
}).add(legendItem.group);
|
|
41
42
|
}
|
|
42
43
|
});
|
|
43
44
|
}
|