Skip to content

Commit b43039a

Browse files
author
pipeline
committed
v29.1.41 is released
1 parent ab2b9be commit b43039a

File tree

118 files changed

+1770
-510
lines changed

Some content is hidden

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

118 files changed

+1770
-510
lines changed

controls/barcodegenerator/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## [Unreleased]
44

5-
## 29.1.40 (2025-04-29)
5+
## 29.1.41 (2025-05-06)
66

77
### Barcode
88

controls/calendars/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## [Unreleased]
44

5-
## 29.1.40 (2025-04-29)
5+
## 29.1.41 (2025-05-06)
66

77
### DateTimePicker
88

controls/charts/CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
## [Unreleased]
44

5+
## 29.1.41 (2025-05-06)
6+
7+
### Accumulation Chart
8+
9+
#### Bug Fixes
10+
11+
- `#I580016` - Wrapped data labels are now correctly positioned in pyramid charts when smart labels are enabled.
12+
13+
### Chart
14+
15+
#### Bug Fixes
16+
17+
- `#I715763` - Stacking labels now render correctly for grouped stacking column series.
18+
- `#I713317` - Stripline text now positions correctly when rotation is applied.
19+
520
## 29.1.40 (2025-04-29)
621

722
### Accumulation Chart

controls/charts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@syncfusion/ej2-charts",
3-
"version": "29.1.35",
3+
"version": "29.1.40",
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/series/stacking-column-series.spec.ts

+158-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import '../../../node_modules/es6-promise/dist/es6-promise';
1919
import { tooltipData21, tooltipData22, datetimeData21, negativeDataPoint, seriesData1, rotateData1, rotateData2 } from '../base/data.spec';
2020
import { EmitType } from '@syncfusion/ej2-base';
2121
import {profile , inMB, getMemoryProfile} from '../../common.spec';
22-
import { ILoadedEventArgs, IAnimationCompleteEventArgs, IPointRenderEventArgs } from '../../../src/chart/model/chart-interface';
22+
import { ILoadedEventArgs, IAnimationCompleteEventArgs, IPointRenderEventArgs, IAxisLabelRenderEventArgs, ITooltipRenderEventArgs } from '../../../src/chart/model/chart-interface';
2323
import { Legend } from '../../../src/chart/legend/legend';
2424

2525
Chart.Inject(LineSeries, StackingColumnSeries, DateTime, Category, DataLabel, ColumnSeries, Legend);
@@ -1972,6 +1972,163 @@ describe('Chart Control', () => {
19721972
chartObj.refresh();
19731973
});
19741974
});
1975+
describe('StackingColumn and StackingColumn100 Series in Cyliderical shape', () => {
1976+
let chartObj: Chart;
1977+
let loaded: EmitType<ILoadedEventArgs>;
1978+
let animate: EmitType<IAnimationCompleteEventArgs>;
1979+
let element: HTMLElement = createElement('div', { id: 'container' });
1980+
beforeAll(() => {
1981+
document.body.appendChild(element);
1982+
chartObj = new Chart(
1983+
{
1984+
primaryXAxis: {
1985+
interval: 1,
1986+
valueType: 'Category',
1987+
},
1988+
//Initializing Primary Y Axis
1989+
primaryYAxis: {
1990+
maximum: 60,
1991+
interval: 10,
1992+
},
1993+
stackLabels: {
1994+
visible: true,
1995+
format: '{value}M',
1996+
font: {
1997+
size: '12px',
1998+
},
1999+
},
2000+
//Initializing Chart Series
2001+
series: [
2002+
{
2003+
type: 'StackingColumn',
2004+
dataSource: [
2005+
{ x: '2018', y: 24.5 },
2006+
{ x: '2019', y: 25.6 },
2007+
{ x: '2020', y: 29 },
2008+
{ x: '2021', y: 28.5 },
2009+
{ x: '2022', y: 30.6 },
2010+
],
2011+
xName: 'x',
2012+
stackingGroup: 'Asia',
2013+
yName: 'y',
2014+
name: 'Iran',
2015+
columnWidth: 0.6,
2016+
marker: { dataLabel: { visible: true } },
2017+
},
2018+
{
2019+
type: 'StackingColumn',
2020+
dataSource: [
2021+
{ x: '2018', y: 6.2 },
2022+
{ x: '2019', y: 15.6 },
2023+
{ x: '2020', y: 14.3 },
2024+
{ x: '2021', y: 9.3 },
2025+
{ x: '2022', y: 7.8 },
2026+
],
2027+
xName: 'x',
2028+
stackingGroup: 'Asia',
2029+
yName: 'y',
2030+
name: 'Indonesia',
2031+
columnWidth: 0.6,
2032+
marker: { dataLabel: { visible: true } },
2033+
},
2034+
{
2035+
type: 'StackingColumn',
2036+
dataSource: [
2037+
{ x: '2018', y: 24.5 },
2038+
{ x: '2019', y: 23.2 },
2039+
{ x: '2020', y: 20.4 },
2040+
{ x: '2021', y: 23.2 },
2041+
{ x: '2022', y: 24.5 },
2042+
],
2043+
xName: 'x',
2044+
stackingGroup: 'Europe',
2045+
yName: 'y',
2046+
name: 'Italy',
2047+
columnWidth: 0.6,
2048+
marker: { dataLabel: { visible: true } },
2049+
},
2050+
{
2051+
type: 'StackingColumn',
2052+
dataSource: [
2053+
{ x: '2018', y: 15.4 },
2054+
{ x: '2019', y: 21.1 },
2055+
{ x: '2020', y: 13.9 },
2056+
{ x: '2021', y: 11.6 },
2057+
{ x: '2022', y: 14.4 },
2058+
],
2059+
xName: 'x',
2060+
stackingGroup: 'Europe',
2061+
yName: 'y',
2062+
name: 'France',
2063+
columnWidth: 0.6,
2064+
marker: { dataLabel: { visible: true } },
2065+
},
2066+
],
2067+
2068+
//Initializing Chart title
2069+
title: 'Steel Production by Countries, Grouped by Continent',
2070+
//Initializing User Interaction Tooltip
2071+
tooltip: {
2072+
enable: true,
2073+
format: '${point.x} : <b>${point.y} Mmt',
2074+
},
2075+
2076+
legendSettings: {
2077+
visible: true,
2078+
enableHighlight: true,
2079+
shapeWidth: 9,
2080+
shapeHeight: 9,
2081+
},
2082+
load: (args: ILoadedEventArgs) => {
2083+
2084+
},
2085+
axisLabelRender: (args: IAxisLabelRenderEventArgs) => {
2086+
const value: number = parseInt(args.text.replace(/,/g, ''), 10);
2087+
if (value >= 1000) {
2088+
args.text = value / 1000 + 'K';
2089+
}
2090+
},
2091+
tooltipRender: (args: ITooltipRenderEventArgs) => {
2092+
if (args.text) {
2093+
let value: string = args.point.y.toLocaleString('en-US');
2094+
args.text = `${args.series.name}: <b>${value}</b>`;
2095+
}
2096+
},
2097+
});
2098+
chartObj.appendTo('#container');
2099+
});
2100+
2101+
afterAll((): void => {
2102+
chartObj.destroy();
2103+
element.remove();
2104+
});
2105+
it('Stacking column grouped - stacking label position', function (done) {
2106+
loaded = function (args) {
2107+
let stackLabel = document.getElementById('container_StackLabel_0').getAttribute('x');
2108+
let stackLabel1 = document.getElementById('container_StackLabel_2').getAttribute('x');
2109+
let stackLabel2 = document.getElementById('container_StackLabel_4').getAttribute('x');
2110+
let stackContent = document.getElementById('container_StackLabel_2').textContent;
2111+
expect(stackContent).toBe('43.3M');
2112+
stackContent = document.getElementById('container_StackLabel_0').textContent;
2113+
expect(stackContent).toBe('30.7M');
2114+
stackContent = document.getElementById('container_StackLabel_4').textContent;
2115+
expect(stackContent).toBe('38.4M');
2116+
expect(stackLabel).toBe('83.355');
2117+
expect(stackLabel1).toBe('373.95500000000004');
2118+
expect(stackLabel2).toBe('664.5550000000001');
2119+
stackLabel = document.getElementById('container_StackLabel_0').getAttribute('y');
2120+
stackLabel1 = document.getElementById('container_StackLabel_2').getAttribute('y');
2121+
stackLabel2 = document.getElementById('container_StackLabel_4').getAttribute('y');
2122+
expect(stackLabel).toBe('198.42875');
2123+
expect(stackLabel1).toBe('127.39625000000004');
2124+
expect(stackLabel2).toBe('155.01999999999998');
2125+
done();
2126+
};
2127+
chartObj.loaded = loaded;
2128+
chartObj.refresh();
2129+
});
2130+
});
2131+
19752132
it('memory leak', () => {
19762133
profile.sample();
19772134
let average: any = inMB(profile.averageChange)

controls/charts/spec/pie/renderer/pyramid-series.spec.ts

+54
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,60 @@ describe('Accumulation Chart Control', () => {
837837
});
838838

839839
});
840+
describe('Pyramid Series - Checking datalabel with enabled wrap.', () => {
841+
let ele: HTMLElement;
842+
let pie: AccumulationChart;
843+
let id: string = 'ej2container';
844+
beforeAll((): void => {
845+
ele = createElement('div', { id: id });
846+
document.body.appendChild(ele);
847+
848+
pie = new AccumulationChart({
849+
enableSmartLabels: true,
850+
851+
series: [{
852+
type: 'Pyramid', dataSource: [{ x: 'Milk, Youghnut, Cheese', y: 435, text: 'Milk, Youghnut, Cheese: 435 cal' },
853+
{ x: 'Vegetables', y: 470, text: 'Vegetables: 470 cal' },
854+
{ x: 'Meat, Poultry, Fish', y: 475, text: 'Meat, Poultry, Fish: 475 cal' },
855+
{ x: 'Rice, Pasta', y: 930, text: 'Rice, Pasta: 930 cal' },
856+
{ x: 'Fruits', y: 520, text: 'Fruits: 520 cal' }], xName: 'x', yName: 'y', width: '45%', height: '80%',
857+
neckWidth: '15%', gapRatio: 0.03, name: 'Food',
858+
dataLabel: {
859+
textWrap: 'Wrap',
860+
name: 'text', visible: true, position: 'Inside', connectorStyle: {length: '20px'}, font: {
861+
fontWeight: '600'
862+
}
863+
}, explode: true, emptyPointSettings: { mode: 'Drop', fill: 'red' },
864+
865+
}],
866+
legendSettings: {
867+
visible: false
868+
},
869+
870+
tooltip: { enable: true, format: '${point.x} : <b>${point.y} cal</b>',header:'' },
871+
872+
title: 'Food Comparison Chart',
873+
});
874+
pie.appendTo('#' + id);
875+
});
876+
877+
afterAll((): void => {
878+
pie.loaded = null;
879+
pie.destroy();
880+
removeElement(id);
881+
});
882+
it('checking pyramid series with removePoint', (done: Function) => {
883+
pie.loaded = (args: Object): void => {
884+
pie.loaded = null;
885+
const element: Element = document.getElementById('ej2container_datalabel_Series_0_text_0');
886+
expect(element.getAttribute('x')).toBe('440.06344942579506');
887+
expect(element.getAttribute('y')).toBe('97.52150530035335');
888+
expect(element.textContent).toBe('Milk, Youghnut, Cheese: 435 cal');
889+
done();
890+
};
891+
pie.refresh();
892+
});});
893+
840894
it('memory leak', () => {
841895
profile.sample();
842896
let average: any = inMB(profile.averageChange)

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

+1
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ export class AccumulationDataLabel extends AccumulationBase {
215215
textSize = this.getTextSize(point.labelCollection, dataLabel);
216216
textSize.height += 4; // 4 for calculation with padding for smart label shape
217217
textSize.width += 4;
218+
point.textSize = textSize;
218219
this.getLabelRegion(point, point.labelPosition, textSize, labelRadius, this.marginValue);
219220
previousPoint = this.findPreviousPoint(points, point.index, point.labelPosition);
220221
if (previousPoint && (isOverlap(point.labelRegion, previousPoint.labelRegion) ||

controls/charts/src/chart/axis/strip-line.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,10 @@ export class StripLine {
378378
ty = this.getTextStart(ty - textMid, rect.height, stripline.verticalAlignment) +
379379
(stripline.verticalAlignment === 'Start' && !isRotationNull ? (textSize.height / 4) : 0);
380380
anchor = isRotationNull ? this.invertAlignment(stripline.verticalAlignment) : stripline.horizontalAlignment;
381-
anchor = tx - textSize.width / 2 < axis.rect.x ? 'Start' : tx + textSize.width / 2 > axis.rect.width ? 'End' : anchor;
381+
const isVertical: boolean = Math.abs(stripline.rotation) === 90 || Math.abs(stripline.rotation) === 270;
382+
const halfSize: number = isVertical ? textSize.height / 2 : textSize.width / 2;
383+
anchor = (tx - halfSize < axis.rect.x) ? 'Start' :
384+
(tx + halfSize > axis.rect.x + axis.rect.width) ? 'End' : anchor;
382385
} else {
383386
tx = this.getTextStart(tx, rect.width, stripline.horizontalAlignment);
384387
ty = this.getTextStart(

controls/charts/src/chart/chart.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -3071,6 +3071,7 @@ export class Chart extends Component<HTMLElement> implements INotifyPropertyChan
30713071
this.seriesElements = null;
30723072
this.chartAxisLayoutPanel = null;
30733073
this.dataLabelCollections = null;
3074+
this.visibleSeriesCount = null;
30743075
this.dataLabelElements = null;
30753076
this.yAxisElements = null;
30763077
const element: HTMLElement = document.getElementById(this.element.id + 'Keyboard_chart_focus');
@@ -4277,7 +4278,7 @@ export class Chart extends Component<HTMLElement> implements INotifyPropertyChan
42774278
args: [this]
42784279
});
42794280
}
4280-
if (dataLabelEnable) {
4281+
if (dataLabelEnable || this.stackLabels.visible) {
42814282
modules.push({
42824283
member: 'DataLabel',
42834284
args: [this, series]

0 commit comments

Comments
 (0)