Skip to content

Commit d367cac

Browse files
Merge pull request #316 from attitude/feature/areas-in-extra-props
Stacked Area Chart: Pass `areas` down to children
2 parents 03d47bf + 22187c2 commit d367cac

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/stacked-area-chart.js

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ class AreaStack extends PureComponent {
119119
width,
120120
height,
121121
ticks,
122+
areas,
122123
}
123124

124125
return (

src/stacked-bar-chart/stacked-bar-grouped.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ class StackedBarGrouped extends PureComponent {
6969
areas = series.map((stack, stackIndex) => {
7070
return stack.map((serie, keyIndex) => {
7171
return serie.map((entry, entryIndex) => {
72+
7273
const leftMargin = series.length > 1 ? innerBarSpace / 2 : 0
74+
7375
const path = shape
7476
.area()
7577
.x0(d => x(d[0]))
@@ -111,6 +113,7 @@ class StackedBarGrouped extends PureComponent {
111113
showTopBorder,
112114
showBottomBorder,
113115
)
116+
114117
return {
115118
path: this.commandsToSvgPath(commands),
116119
color: colors[stackIndex][keyIndex],
@@ -174,6 +177,7 @@ class StackedBarGrouped extends PureComponent {
174177
if (showTopBorder) {
175178
const topRight1 = [ x1, y0 + borderRadius ]
176179
const topRight2 = [ x1 - borderRadius, y0 ]
180+
177181
commands.push({ marker: 'L', values: topRight1 })
178182
commands.push({
179183
marker: 'C',
@@ -193,7 +197,7 @@ class StackedBarGrouped extends PureComponent {
193197
commands
194198
.map(command => `${command.marker} ${command.values.join(',')}`)
195199
.join(' ')
196-
.trim()
200+
.trim();
197201

198202
calcExtent(values) {
199203
const {

0 commit comments

Comments
 (0)