Skip to content

Commit

Permalink
adding lines in vertical stacked bar chart complex combo chart (micro…
Browse files Browse the repository at this point in the history
…soft#15551)

* adding lines in the vertical stacked bar chart

* Change files

* fix build errors

* fix build erros

* when only the line is highlighted we should show callout to that

* fix build issues

* making the callout sort according to the rects

* updating snapshots

Co-authored-by: v-sivsar <[email protected]>
  • Loading branch information
Jakub Konka and v-sivsar committed Jan 27, 2021
1 parent 540e928 commit 8c73eb3
Show file tree
Hide file tree
Showing 8 changed files with 662 additions and 73 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "prerelease",
"comment": "adding lines in vertical stacked bar chart complex combo chart (#15551)",
"packageName": "@fluentui/react-charting",
"email": "[email protected]",
"dependentChangeType": "patch",
"date": "2021-01-27T12:12:26.919Z"
}
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,26 @@ export class CartesianChartBase extends React.Component<IModifiedCartesianChartP
{calloutProps!.YValueHover &&
calloutProps!.YValueHover.map((yValue: IYValueHover, index: number, yValues: IYValueHover[]) => {
const isLast: boolean = index + 1 === yValues.length;
const { shouldDrawBorderBottom = false } = yValue;
return (
<div
key={`callout-content-${index}`}
style={yValueHoverSubCountsExists ? { display: 'inline-block' } : {}}
style={
yValueHoverSubCountsExists
? {
display: 'inline-block',
...(shouldDrawBorderBottom && {
borderBottom: `1px solid ${this.props.theme!.semanticColors.menuDivider}`,
paddingBottom: '10px',
}),
}
: {
...(shouldDrawBorderBottom && {
borderBottom: `1px solid ${this.props.theme!.semanticColors.menuDivider}`,
paddingBottom: '10px',
}),
}
}
>
{this._getCalloutContent(yValue, index, yValueHoverSubCountsExists, isLast)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ export interface IYValueHover {
y?: number;
color?: string;
data?: string | number;
shouldDrawBorderBottom?: boolean;
yAxisCalloutData?: string | { [id: string]: number };
}

Expand Down
Loading

0 comments on commit 8c73eb3

Please sign in to comment.