@progress/kendo-charts 2.5.4-dev.202410140828 → 2.6.0-dev.202410171740
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/dist/cdn/js/kendo-charts.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/chart/area-chart/area-segment.js +3 -2
- package/dist/es/chart/bar-chart/bar.js +3 -3
- package/dist/es/chart/bubble-chart/bubble.js +3 -2
- package/dist/es/chart/bullet-chart/bullet.js +3 -2
- package/dist/es/chart/candlestick-chart/candlestick.js +3 -2
- package/dist/es/chart/chart.js +39 -0
- package/dist/es/chart/constants.js +2 -0
- package/dist/es/chart/donut-chart/donut-chart.js +2 -0
- package/dist/es/chart/funnel-chart/funnel-chart.js +2 -0
- package/dist/es/chart/funnel-chart/funnel-segment.js +3 -2
- package/dist/es/chart/heatmap-chart/heatmap-chart.js +1 -0
- package/dist/es/chart/heatmap-chart/heatmap-point.js +1 -0
- package/dist/es/chart/legend/legend-item.js +21 -1
- package/dist/es/chart/line-chart/line-point.js +1 -0
- package/dist/es/chart/mixins/pie-chart-mixin.js +1 -0
- package/dist/es/chart/pie-chart/pie-chart.js +2 -0
- package/dist/es/chart/pie-chart/pie-segment.js +3 -3
- package/dist/es/chart/register-charts.js +13 -13
- package/dist/es/core/box-element.js +3 -2
- package/dist/es/core/pattern.js +27 -0
- package/dist/es/core.js +1 -0
- package/dist/es2015/chart/area-chart/area-segment.js +3 -2
- package/dist/es2015/chart/bar-chart/bar.js +3 -3
- package/dist/es2015/chart/bubble-chart/bubble.js +3 -2
- package/dist/es2015/chart/bullet-chart/bullet.js +3 -2
- package/dist/es2015/chart/candlestick-chart/candlestick.js +3 -2
- package/dist/es2015/chart/chart.js +39 -0
- package/dist/es2015/chart/constants.js +2 -0
- package/dist/es2015/chart/donut-chart/donut-chart.js +2 -0
- package/dist/es2015/chart/funnel-chart/funnel-chart.js +2 -0
- package/dist/es2015/chart/funnel-chart/funnel-segment.js +3 -2
- package/dist/es2015/chart/heatmap-chart/heatmap-chart.js +1 -0
- package/dist/es2015/chart/heatmap-chart/heatmap-point.js +1 -0
- package/dist/es2015/chart/legend/legend-item.js +19 -1
- package/dist/es2015/chart/line-chart/line-point.js +1 -0
- package/dist/es2015/chart/mixins/pie-chart-mixin.js +1 -0
- package/dist/es2015/chart/pie-chart/pie-chart.js +2 -0
- package/dist/es2015/chart/pie-chart/pie-segment.js +3 -3
- package/dist/es2015/chart/register-charts.js +13 -13
- package/dist/es2015/core/box-element.js +3 -2
- package/dist/es2015/core/pattern.js +23 -0
- package/dist/es2015/core.js +1 -0
- package/dist/npm/main.js +126 -30
- package/dist/systemjs/kendo-charts.js +1 -1
- package/package.json +3 -3
|
@@ -2,6 +2,7 @@ import { drawing as draw, geometry as geom } from '@progress/kendo-drawing';
|
|
|
2
2
|
import LineSegment from '../line-chart/line-segment';
|
|
3
3
|
|
|
4
4
|
import { append, deepExtend, isFunction, last } from '../../common';
|
|
5
|
+
import { createPatternFill } from '../../core/pattern';
|
|
5
6
|
|
|
6
7
|
var AreaSegment = (function (LineSegment) {
|
|
7
8
|
function AreaSegment(linePoints, currentSeries, seriesIx, prevSegment, stackPoints) {
|
|
@@ -30,10 +31,10 @@ var AreaSegment = (function (LineSegment) {
|
|
|
30
31
|
});
|
|
31
32
|
|
|
32
33
|
this.createFill({
|
|
33
|
-
fill: {
|
|
34
|
+
fill: createPatternFill(series.pattern, {
|
|
34
35
|
color: color,
|
|
35
36
|
opacity: series.opacity
|
|
36
|
-
},
|
|
37
|
+
}),
|
|
37
38
|
stroke: null
|
|
38
39
|
});
|
|
39
40
|
|
|
@@ -6,7 +6,7 @@ import { CHART_POINT_ROLE_DESCRIPTION, CHART_POINT_CLASSNAME, CHART_POINT_ROLE,
|
|
|
6
6
|
|
|
7
7
|
import hasGradientOverlay from '../utils/has-gradient-overlay';
|
|
8
8
|
|
|
9
|
-
import { ChartElement, Point } from '../../core';
|
|
9
|
+
import { ChartElement, createPatternFill, Point } from '../../core';
|
|
10
10
|
|
|
11
11
|
import PointEventsMixin from '../mixins/point-events-mixin';
|
|
12
12
|
import NoteMixin from '../mixins/note-mixin';
|
|
@@ -155,10 +155,10 @@ var Bar = (function (ChartElement) {
|
|
|
155
155
|
rect.size.width = Math.round(rect.size.width);
|
|
156
156
|
|
|
157
157
|
var path = this.rectVisual = draw.Path.fromRect(rect, {
|
|
158
|
-
fill: {
|
|
158
|
+
fill: createPatternFill(options.pattern, {
|
|
159
159
|
color: this.color,
|
|
160
160
|
opacity: options.opacity
|
|
161
|
-
},
|
|
161
|
+
}),
|
|
162
162
|
stroke: {
|
|
163
163
|
color: this.getBorderColor(),
|
|
164
164
|
width: border.width,
|
|
@@ -5,6 +5,7 @@ import { BORDER_BRIGHTNESS } from '../constants';
|
|
|
5
5
|
|
|
6
6
|
import { CENTER } from '../../common/constants';
|
|
7
7
|
import { deepExtend } from '../../common';
|
|
8
|
+
import { createPatternFill } from '../../core/pattern';
|
|
8
9
|
|
|
9
10
|
var Bubble = (function (LinePoint) {
|
|
10
11
|
function Bubble(value, options) {
|
|
@@ -49,10 +50,10 @@ var Bubble = (function (LinePoint) {
|
|
|
49
50
|
width: border.width,
|
|
50
51
|
opacity: border.opacity
|
|
51
52
|
},
|
|
52
|
-
fill: {
|
|
53
|
+
fill: createPatternFill(this.options.pattern, {
|
|
53
54
|
color: markers.background,
|
|
54
55
|
opacity: highlight.opacity
|
|
55
|
-
}
|
|
56
|
+
})
|
|
56
57
|
});
|
|
57
58
|
|
|
58
59
|
highlightGroup.append(shadow, overlay);
|
|
@@ -14,6 +14,7 @@ import { alignPathToPixel, deepExtend, defined, getTemplate, setDefaultOptions,
|
|
|
14
14
|
import BarLabel from '../bar-chart/bar-label';
|
|
15
15
|
import { CHART_POINT_ROLE_DESCRIPTION, CHART_POINT_CLASSNAME, CHART_POINT_ROLE } from '../constants';
|
|
16
16
|
import AccessibilityAttributesMixin from '../mixins/accessibility-attributes-mixin';
|
|
17
|
+
import { createPatternFill } from '../../core/pattern';
|
|
17
18
|
|
|
18
19
|
var Bullet = (function (ChartElement) {
|
|
19
20
|
function Bullet(value, options) {
|
|
@@ -127,10 +128,10 @@ var Bullet = (function (ChartElement) {
|
|
|
127
128
|
|
|
128
129
|
var options = this.options;
|
|
129
130
|
var body = draw.Path.fromRect(this.box.toRect(), {
|
|
130
|
-
fill: {
|
|
131
|
+
fill: createPatternFill(options.pattern, {
|
|
131
132
|
color: this.color,
|
|
132
133
|
opacity: options.opacity
|
|
133
|
-
},
|
|
134
|
+
}),
|
|
134
135
|
stroke: null
|
|
135
136
|
});
|
|
136
137
|
|
|
@@ -11,6 +11,7 @@ import hasGradientOverlay from '../utils/has-gradient-overlay';
|
|
|
11
11
|
|
|
12
12
|
import { WHITE, LEFT, TOP } from '../../common/constants';
|
|
13
13
|
import { alignPathToPixel, deepExtend, defined, setDefaultOptions, valueOrDefault } from '../../common';
|
|
14
|
+
import { createPatternFill } from '../../core/pattern';
|
|
14
15
|
|
|
15
16
|
var Candlestick = (function (ChartElement) {
|
|
16
17
|
function Candlestick(value, options) {
|
|
@@ -88,10 +89,10 @@ var Candlestick = (function (ChartElement) {
|
|
|
88
89
|
|
|
89
90
|
Candlestick.prototype.createBody = function createBody (container, options) {
|
|
90
91
|
var body = draw.Path.fromRect(this.realBody.toRect(), {
|
|
91
|
-
fill: {
|
|
92
|
+
fill: createPatternFill(options.pattern, {
|
|
92
93
|
color: this.color,
|
|
93
94
|
opacity: options.opacity
|
|
94
|
-
},
|
|
95
|
+
}),
|
|
95
96
|
stroke: null
|
|
96
97
|
});
|
|
97
98
|
|
package/dist/es/chart/chart.js
CHANGED
|
@@ -339,6 +339,7 @@ var Chart = (function (Class) {
|
|
|
339
339
|
this._createPannable();
|
|
340
340
|
this._createZoomSelection();
|
|
341
341
|
this._createMousewheelZoom();
|
|
342
|
+
this._setComputedStyles();
|
|
342
343
|
|
|
343
344
|
this.trigger(RENDER);
|
|
344
345
|
triggerPaneRender(this._plotArea.panes);
|
|
@@ -350,7 +351,16 @@ var Chart = (function (Class) {
|
|
|
350
351
|
this._redrawFocusHighlight();
|
|
351
352
|
};
|
|
352
353
|
|
|
354
|
+
Chart.prototype._setComputedStyles = function _setComputedStyles () {
|
|
355
|
+
var titleHeight = this.titleHeight();
|
|
356
|
+
this.element.style.setProperty('--kendo-chart-computed-title-height', (titleHeight + "px"));
|
|
357
|
+
};
|
|
358
|
+
|
|
353
359
|
Chart.prototype._redrawFocusHighlight = function _redrawFocusHighlight () {
|
|
360
|
+
if (this._destroyed) {
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
|
|
354
364
|
var ref = this;
|
|
355
365
|
var ref_focusState = ref._focusState;
|
|
356
366
|
var legendInFocus = ref_focusState.legendInFocus;
|
|
@@ -541,9 +551,30 @@ var Chart = (function (Class) {
|
|
|
541
551
|
model.append(plotArea);
|
|
542
552
|
model.reflow();
|
|
543
553
|
|
|
554
|
+
this._setTitleBox(title, subtitle);
|
|
555
|
+
|
|
544
556
|
return model;
|
|
545
557
|
};
|
|
546
558
|
|
|
559
|
+
Chart.prototype._setTitleBox = function _setTitleBox (title, subtitle) {
|
|
560
|
+
if (!title && !subtitle) {
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
this._titleBox = (title || subtitle).box.clone();
|
|
565
|
+
|
|
566
|
+
var titlePosition = title ? title.options.position : '';
|
|
567
|
+
var subtitlePosition = subtitle ? subtitle.options.position : '';
|
|
568
|
+
var samePosition = titlePosition === subtitlePosition;
|
|
569
|
+
var subtitleAtTop = subtitlePosition !== 'bottom';
|
|
570
|
+
|
|
571
|
+
if (samePosition && subtitle) {
|
|
572
|
+
this._titleBox.wrap(subtitle.box);
|
|
573
|
+
} else if (title && subtitle && subtitleAtTop) {
|
|
574
|
+
this._titleBox = subtitle.box.clone();
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
|
|
547
578
|
Chart.prototype._modelOptions = function _modelOptions () {
|
|
548
579
|
var options = this.options;
|
|
549
580
|
var size = this.getSize();
|
|
@@ -665,6 +696,14 @@ var Chart = (function (Class) {
|
|
|
665
696
|
return isDefaultPrevented;
|
|
666
697
|
};
|
|
667
698
|
|
|
699
|
+
Chart.prototype.titleHeight = function titleHeight () {
|
|
700
|
+
if (!this._titleBox) {
|
|
701
|
+
return 0;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
return this._titleBox.height();
|
|
705
|
+
};
|
|
706
|
+
|
|
668
707
|
Chart.prototype._attachEvents = function _attachEvents () {
|
|
669
708
|
var obj, obj$1;
|
|
670
709
|
|
|
@@ -122,6 +122,7 @@ var MOUSEWHEEL_ZOOM_RATE = 0.3;
|
|
|
122
122
|
|
|
123
123
|
var DRILLDOWN = "drilldown";
|
|
124
124
|
var DRILLDOWN_FIELD = "drilldown";
|
|
125
|
+
var PATTERN_FIELD = "pattern";
|
|
125
126
|
|
|
126
127
|
var MIN_MOVING_AVERAGE_PERIOD = 2;
|
|
127
128
|
|
|
@@ -158,6 +159,7 @@ export {
|
|
|
158
159
|
TRENDLINE_MOVING_AVERAGE,
|
|
159
160
|
TRENDLINE_POLYNOMIAL,
|
|
160
161
|
TRENDLINE_POWER,
|
|
162
|
+
PATTERN_FIELD,
|
|
161
163
|
CHART_POINT_ROLE, CHART_POINT_CLASSNAME, CHART_POINT_ROLE_DESCRIPTION,
|
|
162
164
|
LEGEND_ITEM_ROLE, LEGEND_ITEM_CLASSNAME,
|
|
163
165
|
LEGEND_ITEM_ARIA_ROLE_DESCRIPTION
|
|
@@ -18,6 +18,8 @@ var DonutChart = (function (PieChart) {
|
|
|
18
18
|
|
|
19
19
|
DonutChart.prototype.addValue = function addValue (value, sector, fields) {
|
|
20
20
|
var segmentOptions = deepExtend({}, fields.series, { index: fields.index });
|
|
21
|
+
segmentOptions.pattern = fields.pattern || segmentOptions.pattern;
|
|
22
|
+
|
|
21
23
|
this.evalSegmentOptions(segmentOptions, value, fields);
|
|
22
24
|
|
|
23
25
|
this.createLegendItem(value, segmentOptions, fields);
|
|
@@ -95,6 +95,8 @@ var FunnelChart = (function (ChartElement) {
|
|
|
95
95
|
|
|
96
96
|
FunnelChart.prototype.createSegment = function createSegment (value, fields) {
|
|
97
97
|
var seriesOptions = deepExtend({}, fields.series);
|
|
98
|
+
seriesOptions.pattern = fields.pattern || seriesOptions.pattern;
|
|
99
|
+
|
|
98
100
|
this.evalSegmentOptions(seriesOptions, value, fields);
|
|
99
101
|
|
|
100
102
|
this.createLegendItem(value, seriesOptions, fields);
|
|
@@ -7,6 +7,7 @@ import { WHITE } from '../../common/constants';
|
|
|
7
7
|
import { deepExtend, setDefaultOptions, getTemplate } from '../../common';
|
|
8
8
|
import AccessibilityAttributesMixin from '../mixins/accessibility-attributes-mixin';
|
|
9
9
|
import { CHART_POINT_CLASSNAME, CHART_POINT_ROLE, CHART_POINT_ROLE_DESCRIPTION } from '../constants';
|
|
10
|
+
import { createPatternFill } from '../../core/pattern';
|
|
10
11
|
|
|
11
12
|
var FunnelSegment = (function (ChartElement) {
|
|
12
13
|
function FunnelSegment(value, options, segmentOptions) {
|
|
@@ -80,10 +81,10 @@ var FunnelSegment = (function (ChartElement) {
|
|
|
80
81
|
var options = this.options;
|
|
81
82
|
var border = options.border;
|
|
82
83
|
var path = draw.Path.fromPoints(this.points, {
|
|
83
|
-
fill: {
|
|
84
|
+
fill: createPatternFill(options.pattern, {
|
|
84
85
|
color: options.color,
|
|
85
86
|
opacity: options.opacity
|
|
86
|
-
},
|
|
87
|
+
}),
|
|
87
88
|
stroke: {
|
|
88
89
|
color: border.color,
|
|
89
90
|
opacity: border.opacity,
|
|
@@ -125,6 +125,7 @@ var HeatmapChart = (function (ChartElement) {
|
|
|
125
125
|
var pointOptions = this.pointOptions(series, fields.seriesIx);
|
|
126
126
|
var color = fields.color || series.color;
|
|
127
127
|
|
|
128
|
+
pointOptions.pattern = fields.pattern || pointOptions.pattern;
|
|
128
129
|
pointOptions = this.evalPointOptions(pointOptions, value, fields);
|
|
129
130
|
|
|
130
131
|
if (isFunction(series.color)) {
|
|
@@ -152,6 +152,7 @@ var HeatmapPoint = (function (ChartElement) {
|
|
|
152
152
|
rotation: markerOptions.rotation,
|
|
153
153
|
background: this.color,
|
|
154
154
|
border: this.markerBorder(),
|
|
155
|
+
pattern: options.pattern,
|
|
155
156
|
borderRadius: markerOptions.borderRadius,
|
|
156
157
|
opacity: this.series.opacity || options.opacity,
|
|
157
158
|
zIndex: valueOrDefault(options.zIndex, this.series.zIndex),
|
|
@@ -114,14 +114,34 @@ var LegendItem = (function (BoxElement) {
|
|
|
114
114
|
return this._markerLineArea;
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
+
LegendItem.prototype._reduceSize = function _reduceSize (object, prop, factor) {
|
|
118
|
+
if ( factor === void 0 ) factor = 0.6;
|
|
119
|
+
|
|
120
|
+
if (typeof object[prop] === 'number') {
|
|
121
|
+
object[prop] = object[prop] * factor;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
|
|
117
125
|
LegendItem.prototype._createSquare = function _createSquare () {
|
|
118
126
|
var options = this.options;
|
|
119
127
|
if (options.type === AREA) {
|
|
128
|
+
var pattern = options.pattern || (options.series || {}).pattern;
|
|
129
|
+
if (pattern) {
|
|
130
|
+
if (typeof pattern === 'function') {
|
|
131
|
+
pattern = pattern(options.series);
|
|
132
|
+
}
|
|
133
|
+
pattern = structuredClone(pattern);
|
|
134
|
+
this._reduceSize(pattern, 'gap');
|
|
135
|
+
this._reduceSize(pattern, 'width');
|
|
136
|
+
this._reduceSize(pattern, 'radius');
|
|
137
|
+
}
|
|
138
|
+
|
|
120
139
|
this._square = new LegendItemSquare(Object.assign({}, {border: options.border,
|
|
121
140
|
vAlign: options.markers.visible ? BOTTOM : CENTER,
|
|
122
141
|
highlight: this._highlightOptions()},
|
|
123
142
|
options.area,
|
|
124
|
-
{
|
|
143
|
+
{pattern: pattern,
|
|
144
|
+
background: options.area.background || options.markerColor}));
|
|
125
145
|
this.markerWrap.append(this._square);
|
|
126
146
|
}
|
|
127
147
|
return this._square;
|
|
@@ -120,6 +120,7 @@ var LinePoint = (function (ChartElement) {
|
|
|
120
120
|
background: options.background,
|
|
121
121
|
border: this.markerBorder(),
|
|
122
122
|
opacity: options.opacity,
|
|
123
|
+
pattern: this.options.pattern,
|
|
123
124
|
zIndex: valueOrDefault(options.zIndex, this.series.zIndex),
|
|
124
125
|
animation: options.animation,
|
|
125
126
|
visual: options.visual,
|
|
@@ -86,6 +86,7 @@ var PieChart = (function (ChartElement) {
|
|
|
86
86
|
callback(value, new Ring(null, 0, 0, currentAngle, angle), {
|
|
87
87
|
owner: this$1,
|
|
88
88
|
category: defined(fields.category) ? fields.category : "",
|
|
89
|
+
pattern: defined(fields.pattern) ? fields.pattern : currentSeries.pattern,
|
|
89
90
|
index: i,
|
|
90
91
|
series: currentSeries,
|
|
91
92
|
seriesIx: seriesIx,
|
|
@@ -122,6 +123,7 @@ var PieChart = (function (ChartElement) {
|
|
|
122
123
|
|
|
123
124
|
PieChart.prototype.addValue = function addValue (value, sector, fields) {
|
|
124
125
|
var segmentOptions = deepExtend({}, fields.series, { index: fields.index });
|
|
126
|
+
segmentOptions.pattern = fields.pattern || segmentOptions.pattern;
|
|
125
127
|
this.evalSegmentOptions(segmentOptions, value, fields);
|
|
126
128
|
|
|
127
129
|
this.createLegendItem(value, segmentOptions, fields);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { drawing as draw, geometry as geom } from '@progress/kendo-drawing';
|
|
2
2
|
|
|
3
|
-
import { ChartElement, ShapeBuilder, TextBox, Box } from '../../core';
|
|
3
|
+
import { ChartElement, ShapeBuilder, TextBox, Box, createPatternFill } from '../../core';
|
|
4
4
|
|
|
5
5
|
import PointEventsMixin from '../mixins/point-events-mixin';
|
|
6
6
|
|
|
@@ -175,10 +175,10 @@ var PieSegment = (function (ChartElement) {
|
|
|
175
175
|
}
|
|
176
176
|
} : {};
|
|
177
177
|
var color = options.color;
|
|
178
|
-
var fill = {
|
|
178
|
+
var fill = createPatternFill(options.pattern, {
|
|
179
179
|
color: color,
|
|
180
180
|
opacity: options.opacity
|
|
181
|
-
};
|
|
181
|
+
});
|
|
182
182
|
var visual = this.createSegment(sector, deepExtend({
|
|
183
183
|
fill: fill,
|
|
184
184
|
stroke: {
|
|
@@ -15,7 +15,7 @@ import { COLUMN, DONUT, PIE, FUNNEL, PYRAMID, BAR, LINE, VERTICAL_LINE, AREA, VE
|
|
|
15
15
|
RANGE_BAR, WATERFALL, HORIZONTAL_WATERFALL, SCATTER, SCATTER_LINE, BUBBLE,
|
|
16
16
|
POLAR_AREA, POLAR_LINE, POLAR_SCATTER, RADAR_AREA, RADAR_COLUMN, RADAR_LINE, CATEGORY,
|
|
17
17
|
RANGE_AREA, VERTICAL_RANGE_AREA, X_ERROR_LOW_FIELD, X_ERROR_HIGH_FIELD, Y_ERROR_LOW_FIELD, Y_ERROR_HIGH_FIELD,
|
|
18
|
-
ERROR_LOW_FIELD, ERROR_HIGH_FIELD, HEATMAP, DRILLDOWN_FIELD, TRENDLINE_SERIES } from './constants';
|
|
18
|
+
ERROR_LOW_FIELD, ERROR_HIGH_FIELD, HEATMAP, DRILLDOWN_FIELD, TRENDLINE_SERIES, PATTERN_FIELD } from './constants';
|
|
19
19
|
import { X, Y, VALUE } from '../common/constants';
|
|
20
20
|
|
|
21
21
|
var COLOR = "color";
|
|
@@ -53,25 +53,25 @@ PlotAreaFactory.current.register(HeatmapPlotArea, [ HEATMAP ]);
|
|
|
53
53
|
|
|
54
54
|
SeriesBinder.current.register(
|
|
55
55
|
[ BAR, COLUMN, LINE, VERTICAL_LINE, AREA, VERTICAL_AREA ],
|
|
56
|
-
[ VALUE ], [ CATEGORY, COLOR, NOTE_TEXT, ERROR_LOW_FIELD, ERROR_HIGH_FIELD, DRILLDOWN_FIELD ]
|
|
56
|
+
[ VALUE ], [ CATEGORY, COLOR, NOTE_TEXT, ERROR_LOW_FIELD, ERROR_HIGH_FIELD, DRILLDOWN_FIELD, PATTERN_FIELD ]
|
|
57
57
|
);
|
|
58
58
|
|
|
59
59
|
SeriesBinder.current.register(
|
|
60
60
|
[ RANGE_COLUMN, RANGE_BAR, RANGE_AREA, VERTICAL_RANGE_AREA ],
|
|
61
|
-
[ FROM, TO ], [ CATEGORY, COLOR, NOTE_TEXT, DRILLDOWN_FIELD ]
|
|
61
|
+
[ FROM, TO ], [ CATEGORY, COLOR, NOTE_TEXT, DRILLDOWN_FIELD, PATTERN_FIELD ]
|
|
62
62
|
);
|
|
63
63
|
|
|
64
64
|
SeriesBinder.current.register(
|
|
65
65
|
[ WATERFALL, HORIZONTAL_WATERFALL ],
|
|
66
|
-
[ VALUE ], [ CATEGORY, COLOR, NOTE_TEXT, SUMMARY_FIELD, DRILLDOWN_FIELD ]
|
|
66
|
+
[ VALUE ], [ CATEGORY, COLOR, NOTE_TEXT, SUMMARY_FIELD, DRILLDOWN_FIELD, PATTERN_FIELD ]
|
|
67
67
|
);
|
|
68
68
|
|
|
69
|
-
SeriesBinder.current.register([ POLAR_AREA, POLAR_LINE, POLAR_SCATTER ], [ X, Y ], [ COLOR, DRILLDOWN_FIELD ]);
|
|
70
|
-
SeriesBinder.current.register([ RADAR_AREA, RADAR_COLUMN, RADAR_LINE ], [ VALUE ], [ CATEGORY, COLOR, DRILLDOWN_FIELD ]);
|
|
69
|
+
SeriesBinder.current.register([ POLAR_AREA, POLAR_LINE, POLAR_SCATTER ], [ X, Y ], [ COLOR, DRILLDOWN_FIELD, PATTERN_FIELD ]);
|
|
70
|
+
SeriesBinder.current.register([ RADAR_AREA, RADAR_COLUMN, RADAR_LINE ], [ VALUE ], [ CATEGORY, COLOR, DRILLDOWN_FIELD, PATTERN_FIELD ]);
|
|
71
71
|
|
|
72
72
|
SeriesBinder.current.register(
|
|
73
73
|
[ FUNNEL, PYRAMID ],
|
|
74
|
-
[ VALUE ], [ CATEGORY, COLOR, "visibleInLegend", "visible", DRILLDOWN_FIELD ]
|
|
74
|
+
[ VALUE ], [ CATEGORY, COLOR, "visibleInLegend", "visible", DRILLDOWN_FIELD, PATTERN_FIELD ]
|
|
75
75
|
);
|
|
76
76
|
|
|
77
77
|
DefaultAggregates.current.register(
|
|
@@ -95,17 +95,17 @@ SeriesBinder.current.register(
|
|
|
95
95
|
);
|
|
96
96
|
|
|
97
97
|
SeriesBinder.current.register(
|
|
98
|
-
[ BUBBLE ], [ X, Y, "size" ], [ COLOR, CATEGORY, NOTE_TEXT ]
|
|
98
|
+
[ BUBBLE ], [ X, Y, "size" ], [ COLOR, CATEGORY, NOTE_TEXT, PATTERN_FIELD ]
|
|
99
99
|
);
|
|
100
100
|
|
|
101
101
|
SeriesBinder.current.register(
|
|
102
102
|
[ HEATMAP ],
|
|
103
|
-
[ X, Y, VALUE ], [ COLOR, NOTE_TEXT ]
|
|
103
|
+
[ X, Y, VALUE ], [ COLOR, NOTE_TEXT, PATTERN_FIELD ]
|
|
104
104
|
);
|
|
105
105
|
|
|
106
106
|
SeriesBinder.current.register(
|
|
107
107
|
[ CANDLESTICK, OHLC ],
|
|
108
|
-
[ "open", "high", "low", "close" ], [ CATEGORY, COLOR, "downColor", NOTE_TEXT ]
|
|
108
|
+
[ "open", "high", "low", "close" ], [ CATEGORY, COLOR, "downColor", NOTE_TEXT, PATTERN_FIELD ]
|
|
109
109
|
);
|
|
110
110
|
|
|
111
111
|
DefaultAggregates.current.register(
|
|
@@ -116,7 +116,7 @@ DefaultAggregates.current.register(
|
|
|
116
116
|
|
|
117
117
|
SeriesBinder.current.register(
|
|
118
118
|
[ BOX_PLOT, VERTICAL_BOX_PLOT ],
|
|
119
|
-
[ "lower", "q1", "median", "q3", "upper", "mean", "outliers" ], [ CATEGORY, COLOR, NOTE_TEXT, DRILLDOWN_FIELD ]
|
|
119
|
+
[ "lower", "q1", "median", "q3", "upper", "mean", "outliers" ], [ CATEGORY, COLOR, NOTE_TEXT, DRILLDOWN_FIELD, PATTERN_FIELD ]
|
|
120
120
|
);
|
|
121
121
|
|
|
122
122
|
DefaultAggregates.current.register(
|
|
@@ -127,7 +127,7 @@ DefaultAggregates.current.register(
|
|
|
127
127
|
|
|
128
128
|
SeriesBinder.current.register(
|
|
129
129
|
[ BULLET, VERTICAL_BULLET ],
|
|
130
|
-
[ "current", "target" ], [ CATEGORY, COLOR, "visibleInLegend", NOTE_TEXT, DRILLDOWN_FIELD ]
|
|
130
|
+
[ "current", "target" ], [ CATEGORY, COLOR, "visibleInLegend", NOTE_TEXT, DRILLDOWN_FIELD, PATTERN_FIELD ]
|
|
131
131
|
);
|
|
132
132
|
|
|
133
133
|
DefaultAggregates.current.register(
|
|
@@ -137,5 +137,5 @@ DefaultAggregates.current.register(
|
|
|
137
137
|
|
|
138
138
|
SeriesBinder.current.register(
|
|
139
139
|
[ PIE, DONUT ],
|
|
140
|
-
[ VALUE ], [ CATEGORY, COLOR, "explode", "visibleInLegend", "visible", DRILLDOWN_FIELD ]
|
|
140
|
+
[ VALUE ], [ CATEGORY, COLOR, "explode", "visibleInLegend", "visible", DRILLDOWN_FIELD, PATTERN_FIELD ]
|
|
141
141
|
);
|
|
@@ -5,6 +5,7 @@ import Box from './box';
|
|
|
5
5
|
|
|
6
6
|
import { BLACK, LEFT, TOP, X, Y } from '../common/constants';
|
|
7
7
|
import { getSpacing, setDefaultOptions, valueOrDefault } from '../common';
|
|
8
|
+
import { createPatternFill } from './pattern';
|
|
8
9
|
|
|
9
10
|
var BoxElement = (function (ChartElement) {
|
|
10
11
|
function BoxElement(options) {
|
|
@@ -108,10 +109,10 @@ var BoxElement = (function (ChartElement) {
|
|
|
108
109
|
opacity: valueOrDefault(border.opacity, options.opacity),
|
|
109
110
|
dashType: border.dashType
|
|
110
111
|
},
|
|
111
|
-
fill: {
|
|
112
|
+
fill: createPatternFill(options.pattern, {
|
|
112
113
|
color: options.background,
|
|
113
114
|
opacity: options.opacity
|
|
114
|
-
},
|
|
115
|
+
}, undefined),
|
|
115
116
|
cursor: options.cursor
|
|
116
117
|
};
|
|
117
118
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { drawing } from '@progress/kendo-drawing';
|
|
2
|
+
import { isFunction } from './../common';
|
|
3
|
+
|
|
4
|
+
var dotsPattern = drawing.dotsPattern;
|
|
5
|
+
var verticalStripesPattern = drawing.verticalStripesPattern;
|
|
6
|
+
var crosshatchPattern = drawing.crosshatchPattern;
|
|
7
|
+
var diagonalStripesPattern = drawing.diagonalStripesPattern;
|
|
8
|
+
var gridPattern = drawing.gridPattern;
|
|
9
|
+
|
|
10
|
+
var patternMap = {
|
|
11
|
+
dots: dotsPattern,
|
|
12
|
+
verticalStripes: verticalStripesPattern,
|
|
13
|
+
crosshatch: crosshatchPattern,
|
|
14
|
+
diagonalStripes: diagonalStripesPattern,
|
|
15
|
+
grid: gridPattern
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export function evaluatePattern(options, point) {
|
|
19
|
+
return isFunction(options) ? options(point) : options;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function createPatternFill(options, fill, point) {
|
|
23
|
+
var patternOptions = evaluatePattern(options, point);
|
|
24
|
+
var pattern = patternOptions && patternMap[patternOptions.type];
|
|
25
|
+
|
|
26
|
+
return pattern ? pattern(Object.assign({}, fill, patternOptions)) : fill;
|
|
27
|
+
}
|
package/dist/es/core.js
CHANGED
|
@@ -27,3 +27,4 @@ export { default as RadarLogarithmicAxis } from './core/radar-logarithmic-axis';
|
|
|
27
27
|
export { default as CurveProcessor } from './core/curve-processor';
|
|
28
28
|
export { default as Gradients } from './core/gradients';
|
|
29
29
|
export { default as rectToBox } from './core/utils/rect-to-box';
|
|
30
|
+
export { createPatternFill } from './core/pattern';
|
|
@@ -2,6 +2,7 @@ import { drawing as draw, geometry as geom } from '@progress/kendo-drawing';
|
|
|
2
2
|
import LineSegment from '../line-chart/line-segment';
|
|
3
3
|
|
|
4
4
|
import { append, deepExtend, isFunction, last } from '../../common';
|
|
5
|
+
import { createPatternFill } from '../../core/pattern';
|
|
5
6
|
|
|
6
7
|
class AreaSegment extends LineSegment {
|
|
7
8
|
constructor(linePoints, currentSeries, seriesIx, prevSegment, stackPoints) {
|
|
@@ -26,10 +27,10 @@ class AreaSegment extends LineSegment {
|
|
|
26
27
|
});
|
|
27
28
|
|
|
28
29
|
this.createFill({
|
|
29
|
-
fill: {
|
|
30
|
+
fill: createPatternFill(series.pattern, {
|
|
30
31
|
color: color,
|
|
31
32
|
opacity: series.opacity
|
|
32
|
-
},
|
|
33
|
+
}),
|
|
33
34
|
stroke: null
|
|
34
35
|
});
|
|
35
36
|
|
|
@@ -6,7 +6,7 @@ import { CHART_POINT_ROLE_DESCRIPTION, CHART_POINT_CLASSNAME, CHART_POINT_ROLE,
|
|
|
6
6
|
|
|
7
7
|
import hasGradientOverlay from '../utils/has-gradient-overlay';
|
|
8
8
|
|
|
9
|
-
import { ChartElement, Point } from '../../core';
|
|
9
|
+
import { ChartElement, createPatternFill, Point } from '../../core';
|
|
10
10
|
|
|
11
11
|
import PointEventsMixin from '../mixins/point-events-mixin';
|
|
12
12
|
import NoteMixin from '../mixins/note-mixin';
|
|
@@ -145,10 +145,10 @@ class Bar extends ChartElement {
|
|
|
145
145
|
rect.size.width = Math.round(rect.size.width);
|
|
146
146
|
|
|
147
147
|
const path = this.rectVisual = draw.Path.fromRect(rect, {
|
|
148
|
-
fill: {
|
|
148
|
+
fill: createPatternFill(options.pattern, {
|
|
149
149
|
color: this.color,
|
|
150
150
|
opacity: options.opacity
|
|
151
|
-
},
|
|
151
|
+
}),
|
|
152
152
|
stroke: {
|
|
153
153
|
color: this.getBorderColor(),
|
|
154
154
|
width: border.width,
|
|
@@ -5,6 +5,7 @@ import { BORDER_BRIGHTNESS } from '../constants';
|
|
|
5
5
|
|
|
6
6
|
import { CENTER } from '../../common/constants';
|
|
7
7
|
import { deepExtend } from '../../common';
|
|
8
|
+
import { createPatternFill } from '../../core/pattern';
|
|
8
9
|
|
|
9
10
|
class Bubble extends LinePoint {
|
|
10
11
|
constructor(value, options) {
|
|
@@ -45,10 +46,10 @@ class Bubble extends LinePoint {
|
|
|
45
46
|
width: border.width,
|
|
46
47
|
opacity: border.opacity
|
|
47
48
|
},
|
|
48
|
-
fill: {
|
|
49
|
+
fill: createPatternFill(this.options.pattern, {
|
|
49
50
|
color: markers.background,
|
|
50
51
|
opacity: highlight.opacity
|
|
51
|
-
}
|
|
52
|
+
})
|
|
52
53
|
});
|
|
53
54
|
|
|
54
55
|
highlightGroup.append(shadow, overlay);
|
|
@@ -14,6 +14,7 @@ import { alignPathToPixel, deepExtend, defined, getTemplate, setDefaultOptions,
|
|
|
14
14
|
import BarLabel from '../bar-chart/bar-label';
|
|
15
15
|
import { CHART_POINT_ROLE_DESCRIPTION, CHART_POINT_CLASSNAME, CHART_POINT_ROLE } from '../constants';
|
|
16
16
|
import AccessibilityAttributesMixin from '../mixins/accessibility-attributes-mixin';
|
|
17
|
+
import { createPatternFill } from '../../core/pattern';
|
|
17
18
|
|
|
18
19
|
class Bullet extends ChartElement {
|
|
19
20
|
constructor(value, options) {
|
|
@@ -120,10 +121,10 @@ class Bullet extends ChartElement {
|
|
|
120
121
|
|
|
121
122
|
const options = this.options;
|
|
122
123
|
const body = draw.Path.fromRect(this.box.toRect(), {
|
|
123
|
-
fill: {
|
|
124
|
+
fill: createPatternFill(options.pattern, {
|
|
124
125
|
color: this.color,
|
|
125
126
|
opacity: options.opacity
|
|
126
|
-
},
|
|
127
|
+
}),
|
|
127
128
|
stroke: null
|
|
128
129
|
});
|
|
129
130
|
|
|
@@ -11,6 +11,7 @@ import hasGradientOverlay from '../utils/has-gradient-overlay';
|
|
|
11
11
|
|
|
12
12
|
import { WHITE, LEFT, TOP } from '../../common/constants';
|
|
13
13
|
import { alignPathToPixel, deepExtend, defined, setDefaultOptions, valueOrDefault } from '../../common';
|
|
14
|
+
import { createPatternFill } from '../../core/pattern';
|
|
14
15
|
|
|
15
16
|
class Candlestick extends ChartElement {
|
|
16
17
|
constructor(value, options) {
|
|
@@ -81,10 +82,10 @@ class Candlestick extends ChartElement {
|
|
|
81
82
|
|
|
82
83
|
createBody(container, options) {
|
|
83
84
|
const body = draw.Path.fromRect(this.realBody.toRect(), {
|
|
84
|
-
fill: {
|
|
85
|
+
fill: createPatternFill(options.pattern, {
|
|
85
86
|
color: this.color,
|
|
86
87
|
opacity: options.opacity
|
|
87
|
-
},
|
|
88
|
+
}),
|
|
88
89
|
stroke: null
|
|
89
90
|
});
|
|
90
91
|
|