Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Added overlap parameter to bar charts #1010

Merged
merged 1 commit into from
Nov 28, 2021
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
1 change: 1 addition & 0 deletions src/core-interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,7 @@ export interface IChartPropsChartBar {
barDir?: string
barGapDepthPct?: number
barGapWidthPct?: number
barOverlapPct?: number
barGrouping?: string
}
export interface IChartPropsChartDoughnut {
Expand Down
2 changes: 1 addition & 1 deletion src/gen-charts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ function makeChartType(chartType: CHART_NAME, data: OptsChartData[], opts: IChar
// 4: Add more chart options (gapWidth, line Marker, etc.)
if (chartType === CHART_TYPE.BAR) {
strXml += ' <c:gapWidth val="' + opts.barGapWidthPct + '"/>'
strXml += ' <c:overlap val="' + ((opts.barGrouping || '').indexOf('tacked') > -1 ? 100 : 0) + '"/>'
strXml += ' <c:overlap val="' + ((opts.barGrouping || '').indexOf('tacked') > -1 ? 100 : (opts.barOverlapPct ? opts.barOverlapPct: 0)) + '"/>'
} else if (chartType === CHART_TYPE.BAR3D) {
strXml += ' <c:gapWidth val="' + opts.barGapWidthPct + '"/>'
strXml += ' <c:gapDepth val="' + opts.barGapDepthPct + '"/>'
Expand Down