Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
Comment thread
Shubhabrata08 marked this conversation as resolved.
"comment": "Minimum height of non zero positive values set to 1% of Max barHeight",
"packageName": "@fluentui/react-charting",
"email": "shubhabrata08@gmail.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -536,11 +536,16 @@ export class VerticalBarChartBase extends React.Component<IVerticalBarChartProps
shouldHighlight: shouldHighlight,
});
const barHeight: number = Math.max(yBarScale(point.y), 0);
if (barHeight < 1) {
let adjustedBarHeight = 0;
Comment thread
Shubhabrata08 marked this conversation as resolved.
if (barHeight <= 0) {
return <React.Fragment key={point.x}> </React.Fragment>;
} else if (barHeight <= Math.ceil(yBarScale(this._yMax) / 100.0)) {
adjustedBarHeight = Math.ceil(yBarScale(this._yMax) / 100.0);
} else {
Comment thread
Shubhabrata08 marked this conversation as resolved.
adjustedBarHeight = barHeight;
}
const xPoint = xBarScale(point.x as number);
const yPoint = containerHeight - this.margins.bottom! - yBarScale(point.y);
const yPoint = containerHeight - this.margins.bottom! - adjustedBarHeight;
return (
<g key={point.x}>
<rect
Expand All @@ -550,7 +555,7 @@ export class VerticalBarChartBase extends React.Component<IVerticalBarChartProps
y={yPoint}
width={this._barWidth}
data-is-focusable={!this.props.hideTooltip}
height={barHeight}
height={adjustedBarHeight}
ref={(e: SVGRectElement) => {
this._refCallback(e, point.legend!);
}}
Expand Down