@zgfe/business-lib 1.2.8 → 1.2.9-heyh.1

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.
@@ -145,10 +145,9 @@ export var getChartOption = function getChartOption(chartType, data) {
145
145
  if (yAxisFormatter) {
146
146
  yAxis.axisLabel.formatter = yAxisFormatter;
147
147
  } else {
148
- yAxis.axisLabel.formatter = yAxisFormatterDefault;
149
- }
150
- if (unit) {
151
- yAxis.name = unit;
148
+ yAxis.axisLabel.formatter = function (value) {
149
+ return yAxisFormatterDefault(value, unit);
150
+ };
152
151
  }
153
152
  if (chartType === 'line_bar') {
154
153
  yAxis.alignTicks = true;
@@ -1,7 +1,7 @@
1
1
  declare const tooltipFormatterDefault: (params: any, resultFormatMap?: {
2
2
  [key: string]: string;
3
3
  } | undefined, unit?: string) => string;
4
- declare const yAxisFormatterDefault: (value: number) => string;
4
+ declare const yAxisFormatterDefault: (value: number, unit?: string) => string;
5
5
  declare const xAxisFormatterDefault: (value: string) => string;
6
6
  declare const mapTooltipFormatter: (params: any) => string | undefined;
7
7
  declare const legendFormatterDefault: (label: string) => string;
@@ -25,6 +25,8 @@ var tooltipFormatterDefault = function tooltipFormatterDefault(params, resultFor
25
25
  lineLabel += '%';
26
26
  } else if (resultFormatMap && resultFormatMap[item.seriesName] && /percent/.test(resultFormatMap[item.seriesName])) {
27
27
  lineLabel = util.toThousands(lineLabel) + '%';
28
+ } else if (unit && unit === 'time') {
29
+ lineLabel = util.timeFormat(lineLabel, 'hh:mm:ss', 1);
28
30
  } else {
29
31
  lineLabel = util.toThousands(lineLabel) + (unit || '');
30
32
  }
@@ -36,8 +38,12 @@ var tooltipFormatterDefault = function tooltipFormatterDefault(params, resultFor
36
38
  });
37
39
  return htmlArray.join('');
38
40
  };
39
- var yAxisFormatterDefault = function yAxisFormatterDefault(value) {
40
- if (parseFloat(String(value)) >= 1000) {
41
+ var yAxisFormatterDefault = function yAxisFormatterDefault(value, unit) {
42
+ if (unit && unit === '%') {
43
+ return value + '%';
44
+ } else if (unit && unit === 'time') {
45
+ return util.timeFormat(value, 'hh:mm:ss', 1);
46
+ } else if (parseFloat(String(value)) >= 1000) {
41
47
  return util.toThousands(parseFloat((value / 1000).toFixed(1))) + 'k';
42
48
  } else {
43
49
  return String(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.2.8",
3
+ "version": "1.2.9-heyh.1",
4
4
  "module": "es/index.js",
5
5
  "typings": "es/index.d.ts",
6
6
  "files": [
@@ -55,7 +55,7 @@
55
55
  "react": "^16.12.0 || ^17.0.0",
56
56
  "yorkie": "^2.0.0"
57
57
  },
58
- "gitHead": "fdc78e3c8067ebeae1ba607f03ce35d4ce0296c2",
58
+ "gitHead": "192b718e301979ac864e71d7506c68b595acb83d",
59
59
  "gitHooks": {
60
60
  "pre-commit": "lint-staged"
61
61
  }