@gravity-ui/chartkit 5.2.1 → 5.3.0
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.
|
@@ -1056,21 +1056,24 @@ function drillOnClick(event, { options, chartType }) {
|
|
|
1056
1056
|
}
|
|
1057
1057
|
const drillDownFilters = filters.map((filter, index) => {
|
|
1058
1058
|
if (level === index) {
|
|
1059
|
+
const point = event.point;
|
|
1060
|
+
const series = point.series;
|
|
1059
1061
|
if (isColorDrillDown) {
|
|
1060
|
-
return
|
|
1062
|
+
return series.name;
|
|
1061
1063
|
}
|
|
1062
|
-
let drillDownFilter =
|
|
1063
|
-
event.point.category ||
|
|
1064
|
-
event.point.name;
|
|
1064
|
+
let drillDownFilter = point.options.drillDownFilterValue || point.category || point.name;
|
|
1065
1065
|
const isDateTime = chartType !== 'pie' &&
|
|
1066
|
-
|
|
1067
|
-
|
|
1066
|
+
series.userOptions.type !== 'pie' &&
|
|
1067
|
+
series.xAxis.options.type === 'datetime';
|
|
1068
1068
|
if (isDateTime) {
|
|
1069
1069
|
drillDownFilter =
|
|
1070
1070
|
chartType === 'scatter' ? drillDownFilter - 180 * 60 * 1000 : drillDownFilter;
|
|
1071
1071
|
}
|
|
1072
|
+
const dateTimeFormat = get(options.drillDownData, 'dateFormat', 'YYYY-MM-DD');
|
|
1073
|
+
const useUTC = get(series, 'chart.time.useUTC');
|
|
1074
|
+
const dateTimeOptions = useUTC ? { timeZone: 'UTC' } : {};
|
|
1072
1075
|
return isDateTime
|
|
1073
|
-
? dateTime({ input: drillDownFilter }).format(
|
|
1076
|
+
? dateTime(Object.assign({ input: drillDownFilter }, dateTimeOptions)).format(dateTimeFormat)
|
|
1074
1077
|
: drillDownFilter;
|
|
1075
1078
|
}
|
|
1076
1079
|
return filter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/chartkit",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "React component used to render charts based on any sources you need",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "git@github.com:gravity-ui/ChartKit.git",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@bem-react/classname": "^1.6.0",
|
|
50
50
|
"@gravity-ui/date-utils": "^2.1.0",
|
|
51
51
|
"@gravity-ui/i18n": "^1.0.0",
|
|
52
|
-
"@gravity-ui/yagr": "^4.
|
|
52
|
+
"@gravity-ui/yagr": "^4.3.0",
|
|
53
53
|
"afterframe": "^1.0.2",
|
|
54
54
|
"d3": "^7.8.5",
|
|
55
55
|
"lodash": "^4.17.21",
|