Skip to content

Commit 82e8135

Browse files
author
pipeline
committed
v19.1.67 is released
1 parent e6620d7 commit 82e8135

File tree

200 files changed

+8212
-1151
lines changed

Some content is hidden

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

200 files changed

+8212
-1151
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.66 (2021-06-01)
5+
## 19.1.67 (2021-06-08)
66

77
### Barcode
88

controls/base/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.66 (2021-06-01)
5+
## 19.1.67 (2021-06-08)
66

77
### Common
88

controls/calendars/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-calendars",
3-
"version": "19.1.64",
3+
"version": "19.1.66",
44
"description": "A complete package of date or time components with built-in features such as date formatting, inline editing, multiple (range) selection, range restriction, month and year selection, strict mode, and globalization.",
55
"author": "Syncfusion Inc.",
66
"license": "SEE LICENSE IN license",

controls/charts/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,22 @@
22

33
## [Unreleased]
44

5+
## 19.1.67 (2021-06-08)
6+
7+
### Chart
8+
9+
#### Bug Fixes
10+
11+
- `#F165670` - Marker Explode is now rendered properly with image.
12+
- `#328528` - Histogram is rendering properly when the `binInterval` value is 0.
13+
- `#328780` - `multiLevelLabelClick` event is now triggering in canvas mode.
14+
515
## 19.1.65 (2021-05-25)
616

717
### Chart
818

19+
### Stock Chart
20+
921
#### Bug Fixes
1022

1123
- `#F165171` - Tooltip for column in stock chart is working properly now.

controls/charts/spec/range-navigator/issue-fix/range-issue.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,15 @@ describe('Range Navigator Issue fixes', () => {
5959
rangeControl.series = [{ dataSource: new DataManager(data), xName: 'x', yName: 'y' }];
6060
rangeControl.refresh();
6161
});
62+
it('checking with background color', (done: Function) => {
63+
rangeControl.loaded = (args: IRangeLoadedEventArgs) => {
64+
rangeElement = document.getElementById('rangeContainer_ChartBorder');
65+
expect(rangeElement.getAttribute("fill")).toEqual("red");
66+
done();
67+
};
68+
rangeControl.background = 'red';
69+
rangeControl.refresh();
70+
});
71+
6272
});
6373
});

controls/charts/src/chart/axis/multi-level-labels.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Axis } from '../axis/axis';
1111
import { FontModel } from '../../common/model/base-model';
1212
import { isNullOrUndefined } from '@syncfusion/ej2-base';
1313
import { textWrap, appendClipElement, appendChildElement } from '../../common/utils/helper';
14-
import { valueToCoefficient, textTrim, textElement } from '../../common/utils/helper';
14+
import { valueToCoefficient, textTrim, textElement, withInBounds } from '../../common/utils/helper';
1515
import { Size, measureText, TextOption, PathOption, Rect, SvgRenderer } from '@syncfusion/ej2-svg-base';
1616
import { MultiLevelLabels, MultiLevelCategories } from '../model/chart-base';
1717
import { IAxisMultiLabelRenderEventArgs, IMultiLevelLabelClickEventArgs } from '../../chart/model/chart-interface';
@@ -38,6 +38,10 @@ export class MultiLevelLabel {
3838
public multiElements: Element;
3939
/** @private */
4040
public labelElement: Element;
41+
/** @private */
42+
public multiLevelLabelRectXRegion: Rect[] = [];
43+
/** @private */
44+
public xLabelCollection: TextOption[] = [];
4145
/**
4246
* Constructor for the logerithmic module.
4347
*
@@ -170,6 +174,11 @@ export class MultiLevelLabel {
170174
this.chart.renderer, options, argsData.textStyle, argsData.textStyle.color || this.chart.themeStyle.axisLabel,
171175
this.labelElement, false, this.chart.redraw, true, null, null, null, null, null, this.chart.enableCanvas
172176
);
177+
if (this.chart.enableCanvas) {
178+
let textSize: Size = measureText(argsData.text, argsData.textStyle);
179+
this.multiLevelLabelRectXRegion.push(new Rect(options.x, options.y, textSize.width, textSize.height));
180+
this.xLabelCollection.push(options);
181+
}
173182
if (multiLevel.border.width > 0 && multiLevel.border.type !== 'WithoutBorder') {
174183
pathRect = this.renderXAxisLabelBorder(
175184
level, endX - startX - padding, axis, startX, startY, labelSize, options, axisRect, argsData.alignment,
@@ -511,11 +520,20 @@ export class MultiLevelLabel {
511520
* @private
512521
*/
513522
public click(event: Event): void {
514-
const targetId: string = (<HTMLElement>event.target).id;
523+
let targetId: string = (<HTMLElement>event.target).id;
515524
const multiLevelID: string = '_Axis_MultiLevelLabel_Level_';
516525
let textId: string;
517526
let elementId: string;
518527
let axisIndex: number;
528+
if (this.chart.enableCanvas) {
529+
for (let i: number = 0; i < this.multiLevelLabelRectXRegion.length; i++) {
530+
if (withInBounds(
531+
event['x'], event['y'], this.multiLevelLabelRectXRegion[i],
532+
this.multiLevelLabelRectXRegion[i].width, this.multiLevelLabelRectXRegion[i].height)) {
533+
targetId = this.xLabelCollection[i].id;
534+
}
535+
}
536+
}
519537
if (targetId.indexOf(multiLevelID) > -1) {
520538
textId = targetId.split(multiLevelID)[1];
521539
elementId = targetId.split(multiLevelID)[0];

controls/charts/src/chart/series/histogram-series.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class HistogramSeries extends ColumnSeries {
4141
series.histogramValues.mean = mean;
4242
series.histogramValues.sDValue = Math.round(Math.sqrt(sumValue / yValues.length - 1));
4343
series.histogramValues.binWidth = series.binInterval ||
44-
Math.round((3.5 * series.histogramValues.sDValue) / Math.pow(yValues.length, 1 / 3));
44+
Math.round((3.5 * series.histogramValues.sDValue) / Math.pow(yValues.length, 1 / 3)) || 1;
4545
}
4646
/**
4747
* Add data points for Histogram series.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export class MarkerExplode extends ChartData {
192192
i ? borderColor : markerShadow,
193193
(marker.opacity || seriesMarker.opacity), null, null
194194
);
195-
const symbol: Element = drawSymbol(location, shape, size, seriesMarker.imageUrl, options, '',
195+
const symbol: Element = drawSymbol(location, shape, size, marker.imageUrl, options, '',
196196
this.chart.svgRenderer, series.clipRect);
197197
// incident: 252450 point click selection not working while maker explode
198198
//symbol.setAttribute('style', 'pointer-events:none');

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ export class Marker extends MarkerExplode {
121121
const markerHeight: number = argsData.point.marker.height || argsData.height;
122122
const markerOpacity: number = argsData.point.marker.opacity || marker.opacity;
123123
const markerShape: ChartShape = argsData.point.marker.shape || argsData.shape;
124+
const imageURL : string = argsData.point.marker.imageUrl || marker.imageUrl;
124125
shapeOption = new PathOption(
125126
symbolId, markerFill, markerBorder.width, markerBorder.color, markerOpacity, null
126127
);
@@ -136,7 +137,7 @@ export class Marker extends MarkerExplode {
136137
markerElement = drawSymbol(
137138
location, markerShape,
138139
new Size(markerWidth, markerHeight),
139-
marker.imageUrl, shapeOption,
140+
imageURL, shapeOption,
140141
point.x.toString() + ':' + y.toString(), this.chart.renderer, series.clipRect
141142
);
142143
appendChildElement(
@@ -146,7 +147,7 @@ export class Marker extends MarkerExplode {
146147
}
147148
point.marker = {
148149
border: markerBorder, fill: markerFill, height: markerHeight,
149-
visible: true, shape: markerShape, width: markerWidth
150+
visible: true, shape: markerShape, width: markerWidth, imageUrl: imageURL
150151
};
151152
} else {
152153
location = null;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ export class ChartData {
210210
public getClosest(series: Series, value: number, xvalues?: number[]): number {
211211
let closest: number; let data: number;
212212
const xData: number[] = xvalues ? xvalues : series.xData;
213-
if (value >= <number>series.xAxis.visibleRange.min && value <= <number>series.xAxis.visibleRange.max) {
213+
if (value >= <number>series.xMin - 0.5 && value <= <number>series.xMax + 0.5) {
214214
for (let i: number = 0; i < xData.length; i++) {
215215
data = xData[i];
216216
if (closest == null || Math.abs(data - value) < Math.abs(closest - value)) {

controls/charts/src/range-navigator/range-navigator-model.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,13 @@ export interface RangeNavigatorModel extends ComponentModel{
232232
*/
233233
value?: number[] | Date[];
234234

235+
/**
236+
* The background color of the chart that accepts value in hex and rgba as a valid CSS color string.
237+
*
238+
* @default null
239+
*/
240+
background?: string;
241+
235242
/**
236243
* Used to format the axis label that accepts any global string format like 'C', 'n1', 'P' etc.
237244
* It also accepts placeholder like '{value}°C' in which value represent the axis label, e.g, 20°C.

controls/charts/src/range-navigator/range-navigator.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,14 @@ export class RangeNavigator extends Component<HTMLElement> {
348348
@Property([])
349349
public value: number[] | Date[];
350350

351+
/**
352+
* The background color of the chart that accepts value in hex and rgba as a valid CSS color string.
353+
*
354+
* @default null
355+
*/
356+
@Property(null)
357+
public background: string;
358+
351359
/**
352360
* Used to format the axis label that accepts any global string format like 'C', 'n1', 'P' etc.
353361
* It also accepts placeholder like '{value}°C' in which value represent the axis label, e.g, 20°C.
@@ -808,7 +816,10 @@ export class RangeNavigator extends Component<HTMLElement> {
808816
arg.currentSize = this.availableSize;
809817
this.trigger('resized', arg);
810818
this.calculateBounds();
811-
this.chartSeries.renderChart(this);
819+
this.chartSeries.processXAxis(this);
820+
this.chartSeries.calculateGroupingBounds(this);
821+
this.chartSeries.processYAxis(this);
822+
this.renderChart();
812823
},
813824
500);
814825
return false;
@@ -891,7 +902,7 @@ export class RangeNavigator extends Component<HTMLElement> {
891902
*/
892903
private renderChartBackground(): void {
893904
const rect: RectOption = new RectOption(
894-
this.element.id + '_ChartBorder', this.themeStyle.background, { width: 0, color: 'transparent' }, 1,
905+
this.element.id + '_ChartBorder', this.background || this.themeStyle.background, { width: 0, color: 'transparent' }, 1,
895906
new Rect(0, 0, this.availableSize.width, this.availableSize.height));
896907
this.svgObject.appendChild(this.renderer.drawRectangle(rect) as HTMLElement);
897908
}
@@ -989,6 +1000,7 @@ export class RangeNavigator extends Component<HTMLElement> {
9891000
case 'skeleton':
9901001
case 'skeletonType':
9911002
case 'secondaryLabelAlignment':
1003+
case "background":
9921004
renderer = true;
9931005
break;
9941006
case 'dataSource':

controls/charts/src/range-navigator/renderer/chart-render.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,12 @@ export class RangeSeries extends NiceInterval {
120120
i++;
121121
}
122122
}
123-
private processXAxis(control: RangeNavigator): void {
123+
/**
124+
* Process x axis for range navigator.
125+
*
126+
* @private
127+
*/
128+
public processXAxis(control: RangeNavigator): void {
124129
const axis: AxisModel = {
125130
minimum: control.minimum, maximum: control.maximum,
126131
interval: control.interval, valueType: control.valueType,
@@ -152,8 +157,9 @@ export class RangeSeries extends NiceInterval {
152157
* Process yAxis for range navigator
153158
*
154159
* @param {RangeNavigator} control RangeNavigator instance
160+
* @private
155161
*/
156-
private processYAxis(control: RangeNavigator): void {
162+
public processYAxis(control: RangeNavigator): void {
157163
const axis: AxisModel = {
158164
majorGridLines: { width: 0 }, rangePadding: 'None',
159165
majorTickLines: { width: 0 }, labelStyle: { size: '0' },
@@ -247,7 +253,12 @@ export class RangeSeries extends NiceInterval {
247253
series.seriesElement.appendChild(series.clipRectElement);
248254
}
249255

250-
private calculateGroupingBounds(control: RangeNavigator): void {
256+
/**
257+
* Calculate grouping bounds for x axis.
258+
*
259+
* @private
260+
*/
261+
public calculateGroupingBounds(control: RangeNavigator): void {
251262
const padding: number = control.margin.bottom;
252263
const labelHeight: number = measureText('string', control.labelStyle).height;
253264
this.calculateDateTimeNiceInterval(this.xAxis, new Size(control.bounds.width, control.bounds.height), this.xMin, this.xMax, 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.66 (2021-06-01)
7+
## 19.1.67 (2021-06-08)
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.66 (2021-06-01)
5+
## 19.1.67 (2021-06-08)
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.66 (2021-06-01)
5+
## 19.1.67 (2021-06-08)
66

77
### DataManager
88

controls/diagrams/CHANGELOG.md

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

33
## [Unreleased]
44

5+
## 19.1.67 (2021-06-08)
6+
7+
### Diagram
8+
9+
#### Bug Fixes
10+
11+
- `#I327457` - The issue with node gradient is not applied while continuously performing the undo and redo functionality issue has been fixed.
12+
- `#330528` - The issue "Connector horizontal Alignment is not rendered properly at initial rendering" has been fixed.
13+
514
## 19.1.66 (2021-06-01)
615

716
### Diagram

controls/diagrams/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-diagrams",
3-
"version": "19.1.65",
3+
"version": "19.1.66",
44
"description": "Feature-rich diagram control to create diagrams like flow charts, organizational charts, mind maps, and BPMN diagrams. Its rich feature set includes built-in shapes, editing, serializing, exporting, printing, overview, data binding, and automatic layouts.",
55
"author": "Syncfusion Inc.",
66
"license": "SEE LICENSE IN license",

controls/diagrams/spec/diagram/annotation/annotation-interaction.spec.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,4 +1650,55 @@ describe('Diagram Control', () => {
16501650
done();
16511651
});
16521652
});
1653+
});
1654+
describe('Check annotation horizontalAlignment value ', () => {
1655+
let diagram: Diagram;
1656+
let ele: HTMLElement;
1657+
let savedata: string;
1658+
1659+
beforeAll((): void => {
1660+
const isDef = (o: any) => o !== undefined && o !== null;
1661+
if (!isDef(window.performance)) {
1662+
console.log("Unsupported environment, window.performance.memory is unavailable");
1663+
this.skip(); //Skips test (in Chai)
1664+
return;
1665+
}
1666+
ele = createElement('div', { id: 'CheckhorizontalAlignment' });
1667+
document.body.appendChild(ele);
1668+
1669+
let connector: ConnectorModel = {};
1670+
connector.id = "connector1";
1671+
connector.sourcePoint = { x: 350, y: 300 };
1672+
connector.targetPoint = { x: 550, y: 300 };
1673+
connector.annotations = [{ id: "con1", content: "connector", annotationType: "String", constraints: 4, visibility: true, rotateAngle: 0, horizontalAlignment: "Left", verticalAlignment: "Center", margin: { left: 0, right: 0, bottom: 0, top: 0 }, style: { strokeWidth: 0, strokeColor: "transparent", fill: "transparent", strokeDashArray: "", opacity: 1, gradient: { type: "None" }, fontSize: 12, fontFamily: "Arial", textOverflow: "Wrap", textDecoration: "None", whiteSpace: "CollapseSpace", textWrapping: "WrapWithOverflow", textAlign: "Center", color: "black", italic: false, bold: false }, offset: 0.5, alignment: "Center", segmentAngle: false }];
1674+
1675+
diagram = new Diagram({
1676+
width: 1000, height: 1000, connectors: [connector]
1677+
});
1678+
diagram.appendTo('#CheckhorizontalAlignment');
1679+
});
1680+
1681+
afterAll((): void => {
1682+
diagram.destroy();
1683+
ele.remove();
1684+
});
1685+
it('Checking connector with annotation horizontalAlignment at initial rendering', (done: Function) => {
1686+
expect(diagram.connectors[0].annotations[0].horizontalAlignment).toEqual('Left');
1687+
let diagramEle = (document.getElementById('CheckhorizontalAlignment') as any).ej2_instances[0];
1688+
let txtElement: Element = document.getElementById('connector1_con1');
1689+
expect((txtElement as any).x.animVal.value).toEqual(450.5);
1690+
expect((txtElement as any).y.animVal.value).toEqual(293.29998779296875);
1691+
done();
1692+
});
1693+
it('Checking connector annotation horizontalAlignment by save and load', (done: Function) => {
1694+
savedata = diagram.saveDiagram();
1695+
diagram.clear();
1696+
diagram.loadDiagram(savedata);
1697+
expect(diagram.connectors[0].annotations[0].horizontalAlignment).toEqual('Left');
1698+
let diagramEle = (document.getElementById('CheckhorizontalAlignment') as any).ej2_instances[0];
1699+
let txtElement: Element = document.getElementById('connector1_con1');
1700+
expect((txtElement as any).x.animVal.value).toEqual(450.5);
1701+
expect((txtElement as any).y.animVal.value).toEqual(293.29998779296875);
1702+
done();
1703+
});
16531704
});

0 commit comments

Comments
 (0)