Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions demos/browser/js/pptxgen.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demos/browser/js/pptxgen.bundle.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions demos/modules/demo_chart.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,7 @@ function genSlide12(pptx) {
dataLabelColor: "FFFFFF",
dataLabelFontSize: 14,
dataLabelPosition: "bestFit", // 'bestFit' | 'outEnd' | 'inEnd' | 'ctr'
chartPieExplosion: 50
});

// TOP-MIDDLE
Expand Down
4 changes: 2 additions & 2 deletions dist/pptxgen.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pptxgen.bundle.js.map

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions dist/pptxgen.cjs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* PptxGenJS 3.11.0-beta @ 2022-09-12T16:11:36.295Z */
/* PptxGenJS 3.11.0-beta @ 2022-10-10T07:28:41.526Z */
'use strict';

var JSZip = require('jszip');
Expand Down Expand Up @@ -4444,6 +4444,9 @@ function makeChartType(chartType, data, opts, valAxisId, catAxisId, isMultiTypeC
strXml += '<c:' + chartType + 'Chart>';
strXml += ' <c:varyColors val="1"/>';
strXml += '<c:ser>';
if (opts.chartPieExplosion) {
strXml += ' <c:explosion val="' + opts.chartPieExplosion + '"/>';
}
strXml += ' <c:idx val="0"/>';
strXml += ' <c:order val="0"/>';
strXml += ' <c:tx>';
Expand All @@ -4465,7 +4468,7 @@ function makeChartType(chartType, data, opts, valAxisId, catAxisId, isMultiTypeC
strXml += createShadowElement(opts.shadow, DEF_SHAPE_SHADOW);
}
strXml += ' </c:spPr>';
//strXml += '<c:explosion val="0"/>'
// strXml += '<c:explosion val="0"/>'
// 2: "Data Point" block for every data row
obj.labels[0].forEach(function (_label, idx) {
strXml += '<c:dPt>';
Expand Down
7 changes: 5 additions & 2 deletions dist/pptxgen.es.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* PptxGenJS 3.11.0-beta @ 2022-09-12T16:11:36.299Z */
/* PptxGenJS 3.11.0-beta @ 2022-10-10T07:28:41.530Z */
import JSZip from 'jszip';

/******************************************************************************
Expand Down Expand Up @@ -4438,6 +4438,9 @@ function makeChartType(chartType, data, opts, valAxisId, catAxisId, isMultiTypeC
strXml += '<c:' + chartType + 'Chart>';
strXml += ' <c:varyColors val="1"/>';
strXml += '<c:ser>';
if (opts.chartPieExplosion) {
strXml += ' <c:explosion val="' + opts.chartPieExplosion + '"/>';
}
strXml += ' <c:idx val="0"/>';
strXml += ' <c:order val="0"/>';
strXml += ' <c:tx>';
Expand All @@ -4459,7 +4462,7 @@ function makeChartType(chartType, data, opts, valAxisId, catAxisId, isMultiTypeC
strXml += createShadowElement(opts.shadow, DEF_SHAPE_SHADOW);
}
strXml += ' </c:spPr>';
//strXml += '<c:explosion val="0"/>'
// strXml += '<c:explosion val="0"/>'
// 2: "Data Point" block for every data row
obj.labels[0].forEach(function (_label, idx) {
strXml += '<c:dPt>';
Expand Down
4 changes: 2 additions & 2 deletions dist/pptxgen.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pptxgen.min.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/core-interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,7 @@ export interface IChartPropsChartPie {
* @default 0
*/
firstSliceAng?: number
chartPieExplosion?: number
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this protect us from bad inputs without having to add manual inline checks? @tjinauyeung

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, these definitions are not checked unfortunately. We're not using any of the TS definitions when using the library.

}
export interface IChartPropsChartRadar {
/**
Expand Down
5 changes: 4 additions & 1 deletion src/gen-charts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1563,6 +1563,9 @@ function makeChartType(chartType: CHART_NAME, data: IOptsChartData[], opts: ICha
strXml += '<c:' + chartType + 'Chart>'
strXml += ' <c:varyColors val="1"/>'
strXml += '<c:ser>'
if (opts.chartPieExplosion && Number.isInteger(opts.chartPieExplosion)) {
strXml += ' <c:explosion val="' + opts.chartPieExplosion + '"/>'
}
strXml += ' <c:idx val="0"/>'
strXml += ' <c:order val="0"/>'
strXml += ' <c:tx>'
Expand All @@ -1583,7 +1586,7 @@ function makeChartType(chartType: CHART_NAME, data: IOptsChartData[], opts: ICha
strXml += createShadowElement(opts.shadow, DEF_SHAPE_SHADOW)
}
strXml += ' </c:spPr>'
//strXml += '<c:explosion val="0"/>'
// strXml += '<c:explosion val="0"/>'

// 2: "Data Point" block for every data row
obj.labels[0].forEach((_label, idx) => {
Expand Down