Skip to content

Commit 21e7060

Browse files
committed
fix types
1 parent 36ff240 commit 21e7060

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/victory-pie/src/victory-pie.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export interface VictoryPieProps
3838
VictoryDatableProps,
3939
VictoryLabelableProps,
4040
VictoryMultiLabelableProps {
41+
curvedLabelComponent?: React.ReactElement;
4142
colorScale?: ColorScalePropType;
4243
cornerRadius?: SliceNumberOrCallback<SliceProps, "cornerRadius">;
4344
endAngle?: number;
@@ -160,6 +161,7 @@ class VictoryPieBase extends React.Component<VictoryPieProps> {
160161
"groupComponent",
161162
"containerComponent",
162163
"labelIndicatorComponent",
164+
"curvedLabelComponent"
163165
];
164166

165167
// Overridden in victory-native
@@ -214,7 +216,7 @@ class VictoryPieBase extends React.Component<VictoryPieProps> {
214216
// For curved labels, we need to create a path component with id and path value of
215217
// label arc. We need to pass this id to the href of textPath component which will
216218
// have label value(tspan) as child component.
217-
if (labelPlacement === "curved") {
219+
if (labelPlacement === "curved" && curvedLabelComponent) {
218220
const labelPathComponents = this.dataKeys.map((_dataKey, index) => {
219221
const curvedLabelProps: CurvedLabelProps = this.getComponentProps(
220222
curvedLabelComponent,
@@ -228,7 +230,6 @@ class VictoryPieBase extends React.Component<VictoryPieProps> {
228230
d: curvedLabelProps.path,
229231
id: curvedLabelProps.id,
230232
key: index,
231-
textAnchor: "middle",
232233
});
233234
});
234235
children.push(...labelPathComponents);

0 commit comments

Comments
 (0)