From c0f18fffeb1a2e0ca38b7a22e01fdcced239bf64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Akyol?= Date: Wed, 13 Apr 2022 17:13:50 +0300 Subject: [PATCH 1/2] Update StackedBarChart.tsx --- src/StackedBarChart.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/StackedBarChart.tsx b/src/StackedBarChart.tsx index 01382418..d2862208 100644 --- a/src/StackedBarChart.tsx +++ b/src/StackedBarChart.tsx @@ -30,6 +30,10 @@ export interface StackedBarChartProps extends AbstractChartProps { data: StackedBarChartData; width: number; height: number; + /** + * Use for 90 degree verticalLabelRotation or extra height for chart + */ + extraHeight: number; chartConfig: AbstractChartConfig; hideLegend: boolean; style?: Partial; @@ -46,6 +50,8 @@ export interface StackedBarChartProps extends AbstractChartProps { /** * The number of horizontal lines */ + horizontalLabelRotation?: number; + verticalLabelRotation?: number; segments?: number; percentile?: boolean; @@ -197,6 +203,9 @@ class StackedBarChart extends AbstractChart< data, withHorizontalLabels = true, withVerticalLabels = true, + verticalLabelRotation = 0, + horizontalLabelRotation = 0, + extraHeight = 0, segments = 4, decimalPlaces, percentile = false, @@ -210,7 +219,10 @@ class StackedBarChart extends AbstractChart< const { borderRadius = 0 } = style; const config = { width, - height + height, + verticalLabelRotation, + horizontalLabelRotation, + extraHeight }; let border = 0; @@ -234,14 +246,14 @@ class StackedBarChart extends AbstractChart< return ( - + {this.renderDefs({ ...config, ...this.props.chartConfig })} Date: Wed, 13 Apr 2022 17:53:07 +0300 Subject: [PATCH 2/2] Update StackedBarChart.tsx --- src/StackedBarChart.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/StackedBarChart.tsx b/src/StackedBarChart.tsx index d2862208..904815b7 100644 --- a/src/StackedBarChart.tsx +++ b/src/StackedBarChart.tsx @@ -33,9 +33,10 @@ export interface StackedBarChartProps extends AbstractChartProps { /** * Use for 90 degree verticalLabelRotation or extra height for chart */ - extraHeight: number; + extraHeight?: number; chartConfig: AbstractChartConfig; - hideLegend: boolean; + hideLegend?: boolean; + hideLabels?: boolean; style?: Partial; barPercentage?: number; decimalPlaces?: number; @@ -139,7 +140,7 @@ class StackedBarChart extends AbstractChart< /> ); - if (!this.props.hideLegend) { + if (!this.props.hideLabels) { ret.push(