@gravity-ui/chartkit 1.6.4 → 1.6.6
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/CHANGELOG.md +14 -0
- package/build/plugins/highcharts/__stories__/mocks/combo-chart-with-same-legend-titles.js +6 -0
- package/build/plugins/highcharts/renderer/helpers/config/config.js +1 -1
- package/build/plugins/highcharts/renderer/helpers/config/handleLegendItemClick.js +7 -7
- package/build/types/index.d.ts +0 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.6.6](https://github.com/gravity-ui/chartkit/compare/v1.6.5...v1.6.6) (2023-02-21)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* add check if chart exists before adjust font size ([#128](https://github.com/gravity-ui/chartkit/issues/128)) ([451e3c1](https://github.com/gravity-ui/chartkit/commit/451e3c119858adffc02fede05eb9f91407b6e31c))
|
|
9
|
+
|
|
10
|
+
## [1.6.5](https://github.com/gravity-ui/chartkit/compare/v1.6.4...v1.6.5) (2023-02-10)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **Highcharts plugin:** fix optional id usage for series identifier ([#125](https://github.com/gravity-ui/chartkit/issues/125)) ([f08b414](https://github.com/gravity-ui/chartkit/commit/f08b4145360db78c9efc6bd056772cd9f21a5fdb))
|
|
16
|
+
|
|
3
17
|
## [1.6.4](https://github.com/gravity-ui/chartkit/compare/v1.6.3...v1.6.4) (2023-02-09)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -2,6 +2,7 @@ export const data = {
|
|
|
2
2
|
data: {
|
|
3
3
|
graphs: [
|
|
4
4
|
{
|
|
5
|
+
id: 'uniq-1',
|
|
5
6
|
title: 'Office Supplies',
|
|
6
7
|
tooltip: {
|
|
7
8
|
chartKitFormatting: true,
|
|
@@ -90,6 +91,7 @@ export const data = {
|
|
|
90
91
|
type: 'line',
|
|
91
92
|
},
|
|
92
93
|
{
|
|
94
|
+
id: 'uniq-2',
|
|
93
95
|
title: 'Technology',
|
|
94
96
|
tooltip: {
|
|
95
97
|
chartKitFormatting: true,
|
|
@@ -136,6 +138,7 @@ export const data = {
|
|
|
136
138
|
type: 'line',
|
|
137
139
|
},
|
|
138
140
|
{
|
|
141
|
+
id: 'uniq-3',
|
|
139
142
|
title: 'Furniture',
|
|
140
143
|
tooltip: {
|
|
141
144
|
chartKitFormatting: true,
|
|
@@ -196,6 +199,7 @@ export const data = {
|
|
|
196
199
|
type: 'line',
|
|
197
200
|
},
|
|
198
201
|
{
|
|
202
|
+
id: 'uniq-4',
|
|
199
203
|
title: 'Furniture',
|
|
200
204
|
tooltip: {
|
|
201
205
|
chartKitFormatting: true,
|
|
@@ -256,6 +260,7 @@ export const data = {
|
|
|
256
260
|
stack: 'c44bfc70-a7a5-11ed-96a0-9bb7dddec993__',
|
|
257
261
|
},
|
|
258
262
|
{
|
|
263
|
+
id: 'uniq-5',
|
|
259
264
|
title: 'Office Supplies',
|
|
260
265
|
tooltip: {
|
|
261
266
|
chartKitFormatting: true,
|
|
@@ -344,6 +349,7 @@ export const data = {
|
|
|
344
349
|
stack: 'c44bfc70-a7a5-11ed-96a0-9bb7dddec993__',
|
|
345
350
|
},
|
|
346
351
|
{
|
|
352
|
+
id: 'uniq-6',
|
|
347
353
|
title: 'Technology',
|
|
348
354
|
tooltip: {
|
|
349
355
|
chartKitFormatting: true,
|
|
@@ -1078,7 +1078,7 @@ function fixTooltipOnClick(event, { options }) {
|
|
|
1078
1078
|
fixTooltip(this.chart.tooltip, options, event);
|
|
1079
1079
|
}
|
|
1080
1080
|
function adjustDonutFontSize(chart, chartSeries, innerWidth, totals) {
|
|
1081
|
-
if (!totals) {
|
|
1081
|
+
if (!totals || !chart || !chartSeries) {
|
|
1082
1082
|
return;
|
|
1083
1083
|
}
|
|
1084
1084
|
const MIN_ACCEPTABLE_INNER_SIZE = 400;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { drawComments, hideComments } from '../comments/drawing';
|
|
2
2
|
import { isNavigatorSeries } from './utils';
|
|
3
|
-
const
|
|
4
|
-
return
|
|
3
|
+
const getSeriesIdentifier = (series) => {
|
|
4
|
+
return series.userOptions.id || series.name;
|
|
5
5
|
};
|
|
6
6
|
const needSetVisible = (seriesName, seriesVisible, chartSeries) => {
|
|
7
7
|
if (!seriesVisible) {
|
|
8
8
|
return false;
|
|
9
9
|
}
|
|
10
10
|
const hasAnotherVisibleSeries = chartSeries
|
|
11
|
-
.filter((series) => series.options.showInLegend !== false &&
|
|
11
|
+
.filter((series) => series.options.showInLegend !== false && getSeriesIdentifier(series) !== seriesName)
|
|
12
12
|
.some((series) => series.visible);
|
|
13
13
|
return seriesVisible && !hasAnotherVisibleSeries;
|
|
14
14
|
};
|
|
15
15
|
const updateSeries = (series, chartSeries, type) => {
|
|
16
|
-
const clickedSeriesName =
|
|
16
|
+
const clickedSeriesName = getSeriesIdentifier(series);
|
|
17
17
|
switch (type) {
|
|
18
18
|
case 'extended': {
|
|
19
19
|
chartSeries.forEach((item) => {
|
|
20
|
-
if (
|
|
20
|
+
if (getSeriesIdentifier(item) === clickedSeriesName) {
|
|
21
21
|
item.setVisible(!item.visible, false);
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
break;
|
|
25
25
|
}
|
|
26
26
|
case 'default': {
|
|
27
|
-
const visible = needSetVisible(
|
|
27
|
+
const visible = needSetVisible(getSeriesIdentifier(series), series.visible, chartSeries);
|
|
28
28
|
chartSeries.forEach((item) => {
|
|
29
|
-
if (
|
|
29
|
+
if (getSeriesIdentifier(item) === clickedSeriesName) {
|
|
30
30
|
item.setVisible(true, false);
|
|
31
31
|
}
|
|
32
32
|
else {
|
package/build/types/index.d.ts
CHANGED
|
@@ -27,10 +27,6 @@ export declare type ChartKitProps<T extends ChartKitType> = {
|
|
|
27
27
|
data: ChartKitWidget[T]['data'];
|
|
28
28
|
id?: string;
|
|
29
29
|
isMobile?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* @depricated please use onRender & onChartLoad instead
|
|
32
|
-
* @param data
|
|
33
|
-
*/
|
|
34
30
|
onLoad?: (data?: ChartKitOnLoadData<T>) => void;
|
|
35
31
|
/**
|
|
36
32
|
* called on each render
|
package/package.json
CHANGED