Revert "Hid wierd percentage and added percent symbol"
continuous-integration/drone/push Build is passing Details

This reverts commit d315f2904e.
This commit is contained in:
Shahan Nedadahandeh 2023-01-26 22:44:45 -05:00
parent d315f2904e
commit 229260cba9
2 changed files with 4 additions and 38 deletions

View File

@ -53,14 +53,6 @@ export type StackedBarProps = {
scalePadding?: number;
/** Margin for each item in the legend */
itemMargin?: string;
/** Hide the first data value in tooltip*/
hideDataValueInTooltip?: boolean;
//** Top tooltip label */
tooltipTopLabel?: string;
//** Bottom tooltip label */
tooltipBottomLabel?: string;
//** Display percentage */
displayPercentage?: boolean;
};
let tooltipTimeout: number;
@ -87,10 +79,6 @@ export const StackedBarGraphVertical = withTooltip<
tooltipData,
hideTooltip,
showTooltip,
hideDataValueInTooltip,
tooltipBottomLabel = "",
tooltipTopLabel = "",
displayPercentage,
}: StackedBarProps & WithTooltipProvidedProps<TooltipData>) => {
const yTotals = data.reduce((allTotals, currCategory) => {
const yTotal = keys.reduce((categoryTotal, k) => {
@ -242,15 +230,8 @@ export const StackedBarGraphVertical = withTooltip<
left={tooltipLeft}
header={tooltipData.key}
>
{hideDataValueInTooltip ? null : (
<p>
{tooltipTopLabel} {tooltipData.bar.data[tooltipData.key]}
{displayPercentage ? "%" : ""}
</p>
)}
<p>
{tooltipBottomLabel} {getCategory(tooltipData.bar.data)}
</p>
<p>{tooltipData.bar.data[tooltipData.key]}</p>
<p>{getCategory(tooltipData.bar.data)}</p>
</TooltipWrapper>
) : null}
</div>
@ -280,10 +261,6 @@ export const StackedBarGraphHorizontal = withTooltip<
tooltipData,
hideTooltip,
showTooltip,
hideDataValueInTooltip,
tooltipBottomLabel = "",
tooltipTopLabel = "",
displayPercentage,
}: StackedBarProps & WithTooltipProvidedProps<TooltipData>) => {
const yTotals = data.reduce((allTotals, currCategory) => {
const yTotal = keys.reduce((categoryTotal, k) => {
@ -432,15 +409,8 @@ export const StackedBarGraphHorizontal = withTooltip<
left={tooltipLeft}
header={tooltipData.key}
>
{hideDataValueInTooltip ? null : (
<p>
{tooltipTopLabel} {tooltipData.bar.data[tooltipData.key]}
{displayPercentage ? "%" : ""}
</p>
)}
<p>
{tooltipBottomLabel} {getCategory(tooltipData.bar.data)}
</p>
<p>{tooltipData.bar.data[tooltipData.key]}</p>
<p>{getCategory(tooltipData.bar.data)}</p>
</TooltipWrapper>
) : null}
</div>

View File

@ -231,8 +231,6 @@ export default function CoopPage() {
]}
data={C7v}
margin={barGraphMargin}
hideDataValueInTooltip
tooltipBottomLabel="Coop Term: "
/>
</div>
</ComponentWrapper>
@ -258,8 +256,6 @@ export default function CoopPage() {
]}
data={C7vi}
margin={barGraphMargin}
tooltipBottomLabel="Coop Term: "
displayPercentage
/>
</div>
</ComponentWrapper>