Skip to content

Commit 32e04f9

Browse files
author
pipeline
committed
v19.1.59 is released
1 parent e97d9f3 commit 32e04f9

File tree

369 files changed

+10447
-5169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

369 files changed

+10447
-5169
lines changed

controls/barcodegenerator/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## [Unreleased]
44

5-
## 19.1.58 (2021-04-27)
5+
## 19.1.59 (2021-05-04)
66

77
### Barcode
88

controls/charts/CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,34 @@
22

33
## [Unreleased]
44

5+
## 19.1.59 (2021-05-04)
6+
7+
### Chart
8+
9+
#### Bug Fixes
10+
11+
- `#308029` - Console error thrown while using special character in the chart container ID issue has fixed.
12+
13+
#### New Features
14+
15+
- `#289399` - Provided support to reverse the legend shape and text.
16+
17+
## 19.1.58 (2021-04-27)
18+
19+
### Accumulation chart
20+
21+
#### Bug Fixes
22+
23+
- `#323707` - Console error thrown while using various radius pie chart inside dashboard layout issue is fixed.
24+
25+
## 19.1.57 (2021-04-20)
26+
27+
### Chart
28+
29+
#### Bug Fixes
30+
31+
- `#F163318` - Need to skip data not available in shared tooltip issue fixed.
32+
533
## 19.1.56 (2021-04-13)
634

735
### Chart

controls/charts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@syncfusion/ej2-charts",
3-
"version": "19.1.56",
3+
"version": "19.1.58",
44
"description": "Feature-rich chart control with built-in support for over 25 chart types, technical indictors, trendline, zooming, tooltip, selection, crosshair and trackball.",
55
"author": "Syncfusion Inc.",
66
"license": "SEE LICENSE IN license",

controls/charts/spec/chart/legend/legend.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,6 +1291,20 @@ describe('Chart Legend', () => {
12911291
chartObj.legendSettings.titlePosition = 'Right';
12921292
chartObj.refresh();
12931293
});
1294+
it('legend with RTL', (done: Function) => {
1295+
chartObj.loaded = (args: Object): void => {
1296+
let legendText: Element = document.getElementById('container_chart_legend_text_0');
1297+
xValue = legendText.getAttribute('x');
1298+
yValue = legendText.getAttribute('y');
1299+
expect(xValue === '331.5' || xValue === '335.5').toBe(true);
1300+
expect(yValue === '419.75' || yValue === '420').toBe(true);
1301+
done();
1302+
};
1303+
chartObj.legendSettings.position = 'Bottom';
1304+
chartObj.legendSettings.titlePosition = 'Top';
1305+
chartObj.legendSettings.isInversed = true;
1306+
chartObj.refresh();
1307+
});
12941308
});
12951309
describe('Legend new paging support checking', () => {
12961310
let chartObj: Chart;

controls/charts/src/accumulation-chart/renderer/dataLabel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ export class AccumulationDataLabel extends AccumulationBase {
691691
element = getElement(id + 'shape_' + point.index);
692692
const startLocation: ChartLocation = element ? new ChartLocation(
693693
+element.getAttribute('x'), +element.getAttribute('y')
694-
) : null;
694+
) : null;
695695
dataLabelElement = this.accumulation.renderer.drawRectangle(new RectOption(
696696
id + 'shape_' + point.index, point.argsData.color, point.argsData.border, 1,
697697
point.labelRegion, dataLabel.rx, dataLabel.ry));
@@ -1134,7 +1134,7 @@ export class AccumulationDataLabel extends AccumulationBase {
11341134
private changeLabelAngle(currentPoint: AccPoints, newAngle: number): void {
11351135
const dataLabel: AccumulationDataLabelSettingsModel = this.accumulation.series[0].dataLabel;
11361136
let variableR: number;
1137-
if (!this.isVariousRadius()) {
1137+
if (this.isVariousRadius()) {
11381138
variableR = this.accumulation.pieSeriesModule.getLabelRadius(this.accumulation.visibleSeries[0], currentPoint);
11391139
}
11401140

controls/charts/src/chart/chart.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,11 +1535,35 @@ export class Chart extends Component<HTMLElement> implements INotifyPropertyChan
15351535
}
15361536
}
15371537

1538+
/**
1539+
*
1540+
* @param elementId
1541+
* Return the proper ID when the special character exist in the ID
1542+
*/
1543+
private isIdHasSpecialCharacter(elementId: string): string {
1544+
const regex: RegExp = /^[A-Za-z0-9 ]+$/;
1545+
let childElementId: string = '';
1546+
if (!regex.test(elementId)) {
1547+
for (let i: number = 0; i < elementId.length; i++) {
1548+
if (!regex.test(elementId[i]) && elementId.indexOf('-') === -1 &&
1549+
elementId.indexOf('_') === -1 && elementId.indexOf('\\') === -1) {
1550+
childElementId += ('\\' + elementId[i]);
1551+
} else {
1552+
childElementId += elementId[i];
1553+
}
1554+
}
1555+
return childElementId;
1556+
} else {
1557+
return elementId;
1558+
}
1559+
}
1560+
15381561
/**
15391562
* Initialize the event handler.
15401563
*/
15411564

15421565
protected preRender(): void {
1566+
this.element.id = this.isIdHasSpecialCharacter(this.element.id);
15431567
// It is used for checking blazor framework or not.
15441568
const blazor: string = 'Blazor';
15451569
this.isBlazor = window[blazor];

controls/charts/src/chart/series/marker-explode.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,13 @@ export class MarkerExplode extends ChartData {
102102
}
103103
if (chart.tooltip.enable) {
104104
const pointData: PointData = chart.chartAreaType === 'PolarRadar' ? this.getData() : null;
105+
const commonXvalues: number[] = this.mergeXvalues(this.chart.visibleSeries);
105106
for (const chartSeries of chart.visibleSeries) {
106107
if (!chartSeries.enableTooltip || chartSeries.category === 'Indicator') {
107108
continue;
108109
}
109110
if (chart.chartAreaType === 'Cartesian' && chartSeries.visible) {
110-
data = this.getClosestX(chart, chartSeries);
111+
data = this.getClosestX(chart, chartSeries, commonXvalues);
111112
} else if (chart.chartAreaType === 'PolarRadar' && chartSeries.visible && pointData.point !== null) {
112113
data = new PointData(chartSeries.points[pointData.point.index], chartSeries);
113114
}

controls/charts/src/chart/user-interaction/tooltip.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,10 @@ export class Tooltip extends BaseTooltip {
158158
this.removeTooltip(this.chart.tooltip.fadeOutDuration);
159159
this.isRemove = false;
160160
} else {
161+
const commonXvalues: number[] = this.mergeXvalues(this.chart.visibleSeries);
161162
for (const series of chart.visibleSeries) {
162163
if (series.visible && !(series.category === 'TrendLine')) {
163-
data = this.getClosestX(chart, series) || data;
164+
data = this.getClosestX(chart, series, commonXvalues) || data;
164165
}
165166
}
166167
}
@@ -328,12 +329,13 @@ export class Tooltip extends BaseTooltip {
328329
const argument: ISharedTooltipRenderEventArgs = {
329330
text: [], cancel: false, name: sharedTooltipRender, data: [], headerText: '', textStyle: this.textStyle
330331
};
332+
const commonXvalues: number[] = this.mergeXvalues(this.chart.visibleSeries);
331333
for (const series of chart.visibleSeries) {
332334
if (!series.enableTooltip || !series.visible) {
333335
continue;
334336
}
335337
if (chart.chartAreaType === 'Cartesian' && series.visible) {
336-
data = this.getClosestX(chart, series);
338+
data = this.getClosestX(chart, series, commonXvalues);
337339
} else if (chart.chartAreaType === 'PolarRadar' && series.visible && pointData.point !== null) {
338340
data = new PointData(series.points[pointData.point.index], series);
339341
}

controls/charts/src/chart/utils/get-data.ts

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -207,22 +207,26 @@ export class ChartData {
207207
/**
208208
* @private
209209
*/
210-
public getClosest(series: Series, value: number): number {
211-
const xData: number[] = series.xData;
212-
let closest: number;
213-
if (value >= <number>series.xMin - 0.5 && value <= <number>series.xMax + 0.5) {
214-
for (const data of xData) {
210+
public getClosest(series: Series, value: number, xvalues?: number[]): number {
211+
let closest: number; let data: number;
212+
const xData: number[] = xvalues ? xvalues : series.xData;
213+
if (value >= <number>series.xAxis.visibleRange.min && value <= <number>series.xAxis.visibleRange.max) {
214+
for (let i: number = 0; i < xData.length; i++) {
215+
data = xData[i];
215216
if (closest == null || Math.abs(data - value) < Math.abs(closest - value)) {
216217
closest = data;
217218
}
218219
}
219-
} else if (xData.length === 1) {
220-
closest = xData[0];
221220
}
222-
return closest;
221+
const isDataExist: boolean = series.xData.indexOf(closest) !== -1;
222+
if (isDataExist) {
223+
return closest;
224+
} else {
225+
return null;
226+
}
223227
}
224228

225-
public getClosestX(chart: Chart, series: Series): PointData {
229+
public getClosestX(chart: Chart, series: Series, xvalues?: number[]): PointData {
226230
let value: number;
227231
const rect: Rect = series.clipRect;
228232
if (!chart.requireInvertedAxis) {
@@ -231,12 +235,28 @@ export class ChartData {
231235
value = getValueYByPoint(chart.mouseY - rect.y, rect.height, series.xAxis);
232236
}
233237

234-
const closest: number = this.getClosest(series, value);
238+
const closest: number = this.getClosest(series, value, xvalues);
235239
for (const point of series.points) {
236240
if (closest === point.xValue && point.visible) {
237241
return new PointData(point, series);
238242
}
239243
}
240244
return null;
241245
}
246+
247+
/**
248+
* Merge all visible series X values for shared tooltip (EJ2-47072)
249+
*
250+
* @param visibleSeries
251+
* @private
252+
*/
253+
public mergeXvalues(visibleSeries: Series[]): number[] {
254+
let collection: number[] = [];
255+
for (let index: number = 0; index < visibleSeries.length; index++) {
256+
collection = collection.concat(visibleSeries[index].xData);
257+
}
258+
return collection.filter((item, index) => {
259+
return index === collection.indexOf(item);
260+
})
261+
}
242262
}

controls/charts/src/common/legend/legend-model.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,14 @@ export interface LegendSettingsModel {
239239

240240
enablePages?: boolean;
241241

242+
/**
243+
* If set to true, legend will be Reversed.
244+
*
245+
* @default false
246+
*/
247+
248+
isInversed?: boolean;
249+
242250
}
243251

244252
/**

controls/charts/src/common/legend/legend.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,15 @@ export class LegendSettings extends ChildProperty<LegendSettings> {
282282

283283
@Property(true)
284284
public enablePages: boolean;
285+
286+
/**
287+
* If set to true, legend will be Reversed.
288+
*
289+
* @default false
290+
*/
291+
292+
@Property(false)
293+
public isInversed: boolean;
285294
}
286295
/**
287296
* Legend base class for Chart and Accumulation chart.
@@ -1036,14 +1045,18 @@ export class BaseLegend {
10361045
const symbolOption: PathOption = new PathOption(
10371046
this.legendID + this.generateId(legendOption, '_shape_', i), symbolColor, strokewidth,
10381047
(isCustomBorder ? borderColor : symbolColor), 1, '', '');
1048+
let textSize: Size = measureText(legendOption.text, this.legend.textStyle);
1049+
let x: number = this.legend.isInversed ? legendOption.location.x + textSize.width + this.legend.shapePadding
1050+
: legendOption.location.x;
1051+
let y: number = legendOption.location.y;
10391052
if (!isCanvas) {
1040-
group.appendChild(drawSymbol(legendOption.location, shape, new Size(this.legend.shapeWidth, this.legend.shapeHeight),
1053+
group.appendChild(drawSymbol({ x: x, y: y }, shape, new Size(this.legend.shapeWidth, this.legend.shapeHeight),
10411054
legendOption.url, symbolOption, this.accessbilityText, this.chart.renderer, null,
10421055
this.isBulletChartControl, control
10431056
));
10441057
} else {
10451058
regionPadding = -this.translatePage(null, this.currentPageNumber - 1, this.currentPageNumber);
1046-
drawSymbol(legendOption.location, shape, new Size(this.legend.shapeWidth, this.legend.shapeHeight), '',
1059+
drawSymbol({ x: x, y: y }, shape, new Size(this.legend.shapeWidth, this.legend.shapeHeight), '',
10471060
symbolOption, this.accessbilityText, this.chart.renderer,
10481061
this.currentPageNumber ? new Rect(0, regionPadding, 0, 0) : null, this.isBulletChartControl, control);
10491062
this.legendRegions.push({
@@ -1058,11 +1071,11 @@ export class BaseLegend {
10581071
symbolOption.fill = legendOption.type === <AccumulationType>'Doughnut' ? '#FFFFFF' : symbolOption.fill;
10591072
if (!isCanvas) {
10601073
// eslint-disable-next-line max-len
1061-
group.appendChild(drawSymbol(legendOption.location, shape, new Size(this.legend.shapeWidth / 2, this.legend.shapeHeight / 2),
1074+
group.appendChild(drawSymbol({ x: x, y: y }, shape, new Size(this.legend.shapeWidth / 2, this.legend.shapeHeight / 2),
10621075
'', symbolOption, this.accessbilityText, null, null,
10631076
this.isBulletChartControl, control));
10641077
} else {
1065-
drawSymbol(legendOption.location, shape, new Size(this.legend.shapeWidth / 2, this.legend.shapeHeight / 2),
1078+
drawSymbol({ x: x, y: y }, shape, new Size(this.legend.shapeWidth / 2, this.legend.shapeHeight / 2),
10661079
'', symbolOption, this.accessbilityText, this.chart.renderer,
10671080
this.currentPageNumber ?
10681081
new Rect(0, -this.translatePage(null, this.currentPageNumber - 1, this.currentPageNumber), 0, 0) : null,
@@ -1110,7 +1123,8 @@ export class BaseLegend {
11101123
const isCanvas: boolean = (this.chart as Chart).enableCanvas;
11111124
textOptions.id = this.legendID + this.generateId(legendOption, '_text_', i);
11121125
textOptions.text = legendOption.text;
1113-
textOptions.x = legendOption.location.x + (legend.shapeWidth / 2) + legend.shapePadding;
1126+
textOptions.x = legend.isInversed ? legendOption.location.x - (legend.shapeWidth / 2) :
1127+
legendOption.location.x + (legend.shapeWidth / 2) + legend.shapePadding;
11141128
textOptions.y = legendOption.location.y + this.maxItemHeight / 4;
11151129
const element : Element =
11161130
textElement(chart.renderer, textOptions, legend.textStyle, fontcolor, group, false, false, false, false,

controls/circulargauge/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## [Unreleased]
66

7-
## 19.1.58 (2021-04-27)
7+
## 19.1.59 (2021-05-04)
88

99
### CircularGauge
1010

controls/compression/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## [Unreleased]
44

5-
## 19.1.58 (2021-04-27)
5+
## 19.1.59 (2021-05-04)
66

77
### Compression
88

controls/data/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## [Unreleased]
44

5-
## 19.1.58 (2021-04-27)
5+
## 19.1.59 (2021-05-04)
66

77
### DataManager
88

controls/diagrams/CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
## [Unreleased]
44

5+
## 19.1.59 (2021-05-04)
6+
7+
### Diagram
8+
9+
#### Bug Fixes
10+
11+
- `#I323457` - This issue "straight line segment not moved in group while dragging grouping node" has been fixed.
12+
- `#I325103` - This issue "Connector alignment is not rendered properly at initial rendering" has been fixed.
13+
- `F164350` - The issue "Annotation hyper link is not working" has been fixed.
14+
- `#319911` - The issue "Customized style disappears when serializing the BPMN shapes" has been fixed.
15+
- `#321939` - The issue "Swimlane send to back node working" has been fixed.
16+
- `#322854` - The issue "Swimlane children disappear while performing the order commands" has been fixed.
17+
- `#323203` - The issue "Exception occurs when try to redo the node's gradient color" has been fixed.
18+
- `#324238` - The issue "An empty space will take place along with the diagram while exporting the diagram into the image" has been fixed.
19+
- `#321284` - The issue "The loaded layout diagram is differ from the saved diagram" has been fixed.
20+
- `F164274` - The issue "Resize functionality of the lane is not working if the can move is false" has been fixed.
21+
522
## 19.1.57 (2021-04-20)
623

724
### Diagram

0 commit comments

Comments
 (0)