@easyv/charts 1.3.14 → 1.3.15

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.
@@ -93,13 +93,15 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
93
93
  gridTemplateColumns: 'repeat(' + Math.min(gridTemplateColumns, length) + ', 1fr)'
94
94
  }
95
95
  }, _series.map(function (series, index) {
96
+ var _series$config, _series$config$line;
97
+
96
98
  var type = series.type,
97
99
  name = series.name,
98
100
  displayName = series.displayName,
99
101
  icon = series.icon,
100
102
  selected = series.selected;
101
103
 
102
- var _icon = (0, _utils.getIcon)(type, icon);
104
+ var _icon = (0, _utils.getIcon)(type, icon, series === null || series === void 0 ? void 0 : (_series$config = series.config) === null || _series$config === void 0 ? void 0 : (_series$config$line = _series$config.line) === null || _series$config$line === void 0 ? void 0 : _series$config$line.type);
103
105
 
104
106
  return /*#__PURE__*/_react["default"].createElement("li", {
105
107
  key: index,
@@ -124,10 +124,15 @@ var getColorList = function getColorList(_ref3) {
124
124
  exports.getColorList = getColorList;
125
125
 
126
126
  var getIcon = function getIcon(type, icon) {
127
+ var lineType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "solid";
128
+
127
129
  switch (type) {
128
130
  case 'area':
129
131
  case 'line':
130
- return icon ? _objectSpread(_objectSpread({}, defaultLineIcon), icon) : defaultLineIcon;
132
+ var color = icon.background;
133
+ return icon ? _objectSpread(_objectSpread(_objectSpread({}, defaultLineIcon), icon), {}, {
134
+ background: lineType == "solid" ? color : "linear-gradient(90deg, ".concat(color, ", ").concat(color, " 66%, transparent 66%) 0 0/33% 100% repeat")
135
+ }) : defaultLineIcon;
131
136
 
132
137
  default:
133
138
  return icon ? _objectSpread(_objectSpread({}, defaultIcon), icon) : defaultIcon;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.3.14",
3
+ "version": "1.3.15",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -30,9 +30,7 @@ export default memo(
30
30
  formatter,
31
31
  }) => {
32
32
  if (!show) return null;
33
-
34
33
  const _series = sortPie(series, order);
35
-
36
34
  const [_alignment, position] = alignment.split(' ');
37
35
  const length = _series.length;
38
36
 
@@ -66,7 +64,7 @@ export default memo(
66
64
  >
67
65
  {_series.map((series, index) => {
68
66
  const { type, name, displayName, icon, selected } = series;
69
- const _icon = getIcon(type, icon);
67
+ const _icon = getIcon(type, icon, series?.config?.line?.type);
70
68
  return (
71
69
  <li
72
70
  key={index}
@@ -80,14 +80,16 @@ const getColorList = ({ type, pure, linear: { stops, angle, opacity } }) => {
80
80
  }
81
81
  return stops.map(({ color, offset }) => ({ color, offset: offset / 100 }));
82
82
  };
83
- const getIcon = (type, icon) => {
83
+ const getIcon = (type, icon, lineType="solid") => {
84
84
  switch (type) {
85
85
  case 'area':
86
86
  case 'line':
87
+ let color = icon.background;
87
88
  return icon
88
89
  ? {
89
90
  ...defaultLineIcon,
90
91
  ...icon,
92
+ background:lineType=="solid"?color:`linear-gradient(90deg, ${color}, ${color} 66%, transparent 66%) 0 0/33% 100% repeat`
91
93
  }
92
94
  : defaultLineIcon;
93
95
  default: