Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@
{
Comment thread
Anush2303 marked this conversation as resolved.
"type": "patch",
"comment": "set reference line legends after the main chart legends",
"packageName": "@fluentui/react-charting",
"email": "anushgupta@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "set reference line legends after the main chart legends",
"packageName": "@fluentui/react-charts",
"email": "anushgupta@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ export class VerticalStackedBarChartBase
legendsOfLine.push(legend);
});
}
const totalLegends: ILegend[] = legendsOfLine.concat(actions);
const totalLegends: ILegend[] = actions.concat(legendsOfLine);
Comment thread
Anush2303 marked this conversation as resolved.
return (
<Legends
legends={totalLegends}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ describe('Vertical stacked bar chart - Subcomponent Legends', () => {
const bars = screen.getAllByText((content, element) => element!.tagName.toLowerCase() === 'rect');
const line = screen.getAllByText((content, element) => element!.tagName.toLowerCase() === 'line');
const legends = screen.getAllByText((content, element) => element!.tagName.toLowerCase() === 'button');
fireEvent.mouseOver(legends[0]);
fireEvent.mouseOver(legends[3]);
// Assert
expect(line[8].getAttribute('opacity')).toEqual('1');
expect(bars[0]).toHaveStyle('opacity: 0.1');
Expand All @@ -436,7 +436,7 @@ describe('Vertical stacked bar chart - Subcomponent Legends', () => {
const legends = screen.getAllByText((content, element) => element!.tagName.toLowerCase() === 'button');
const bars = screen.getAllByText((content, element) => element!.tagName.toLowerCase() === 'rect');
const line = screen.getAllByText((content, element) => element!.tagName.toLowerCase() === 'line');
fireEvent.mouseOver(legends![1]);
fireEvent.mouseOver(legends![0]);

// Assert
expect(line[8].getAttribute('opacity')).toEqual('0.1');
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ describe('Vertical stacked bar chart - Subcomponent Legends', () => {
const bars = screen.getAllByText((content, element) => element!.tagName.toLowerCase() === 'rect');
const line = screen.getAllByText((content, element) => element!.tagName.toLowerCase() === 'line');
const legends = screen.getAllByText((content, element) => element!.tagName.toLowerCase() === 'button');
fireEvent.mouseOver(legends[0]);
fireEvent.mouseOver(legends[3]);
// Assert
expect(line[8].getAttribute('opacity')).toEqual('1');
expect(bars[0]).toHaveAttribute('opacity', '0.1');
Expand All @@ -415,7 +415,7 @@ describe('Vertical stacked bar chart - Subcomponent Legends', () => {
const legends = screen.getAllByText((content, element) => element!.tagName.toLowerCase() === 'button');
const bars = screen.getAllByText((content, element) => element!.tagName.toLowerCase() === 'rect');
const line = screen.getAllByText((content, element) => element!.tagName.toLowerCase() === 'line');
fireEvent.mouseOver(legends![1]);
fireEvent.mouseOver(legends![0]);

// Assert
expect(line[8].getAttribute('opacity')).toEqual('0.1');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export const VerticalStackedBarChart: React.FunctionComponent<VerticalStackedBar
legendsOfLine.push(legend);
});
}
const totalLegends: Legend[] = legendsOfLine.concat(actions);
const totalLegends: Legend[] = actions.concat(legendsOfLine);
return (
<Legends
legends={totalLegends}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,79 +432,79 @@ exports[`Vertical stacked bar chart - Screen resolution Should remain unchanged
style="text-align: unset;"
>
<button
aria-label="Supported Builds"
aria-label="Metadata1"
aria-selected="false"
class="fui-Button fui-legend__legend"
data-overflow-item=""
role="option"
style="--rect-height: 4px; --rect-backgroundColor: #0078d4; --rect-borderColor: #0078d4;"
style="--rect-height: 12px; --rect-backgroundColor: #0078d4; --rect-borderColor: #0078d4;"
type="button"
>
<div
class="fui-legend__rect"
style="height: 4px; background-color: rgb(0, 120, 212); border-color: #0078d4; --rect-content-high-contrast: linear-gradient(to right, #0078d4, #0078d4);"
style="height: 12px; background-color: rgb(0, 120, 212); border-color: #0078d4; --rect-content-high-contrast: linear-gradient(to right, #0078d4, #0078d4);"
/>
<div
class="fui-legend__text"
>
Supported Builds
Metadata1
</div>
</button>
<button
aria-label="Metadata1"
aria-label="Metadata2"
aria-selected="false"
class="fui-Button fui-legend__legend"
data-overflow-item=""
role="option"
style="--rect-height: 12px; --rect-backgroundColor: #0078d4; --rect-borderColor: #0078d4;"
style="--rect-height: 12px; --rect-backgroundColor: #002050; --rect-borderColor: #002050;"
type="button"
>
<div
class="fui-legend__rect"
style="height: 12px; background-color: rgb(0, 120, 212); border-color: #0078d4; --rect-content-high-contrast: linear-gradient(to right, #0078d4, #0078d4);"
style="height: 12px; background-color: rgb(0, 32, 80); border-color: #002050; --rect-content-high-contrast: linear-gradient(to right, #002050, #002050);"
/>
<div
class="fui-legend__text"
>
Metadata1
Metadata2
</div>
</button>
<button
aria-label="Metadata2"
aria-label="Metadata3"
aria-selected="false"
class="fui-Button fui-legend__legend"
data-overflow-item=""
role="option"
style="--rect-height: 12px; --rect-backgroundColor: #002050; --rect-borderColor: #002050;"
style="--rect-height: 12px; --rect-backgroundColor: #00188f; --rect-borderColor: #00188f;"
type="button"
>
<div
class="fui-legend__rect"
style="height: 12px; background-color: rgb(0, 32, 80); border-color: #002050; --rect-content-high-contrast: linear-gradient(to right, #002050, #002050);"
style="height: 12px; background-color: rgb(0, 24, 143); border-color: #00188f; --rect-content-high-contrast: linear-gradient(to right, #00188f, #00188f);"
/>
<div
class="fui-legend__text"
>
Metadata2
Metadata3
</div>
</button>
<button
aria-label="Metadata3"
aria-label="Supported Builds"
aria-selected="false"
class="fui-Button fui-legend__legend"
data-overflow-item=""
role="option"
style="--rect-height: 12px; --rect-backgroundColor: #00188f; --rect-borderColor: #00188f;"
style="--rect-height: 4px; --rect-backgroundColor: #0078d4; --rect-borderColor: #0078d4;"
type="button"
>
<div
class="fui-legend__rect"
style="height: 12px; background-color: rgb(0, 24, 143); border-color: #00188f; --rect-content-high-contrast: linear-gradient(to right, #00188f, #00188f);"
style="height: 4px; background-color: rgb(0, 120, 212); border-color: #0078d4; --rect-content-high-contrast: linear-gradient(to right, #0078d4, #0078d4);"
/>
<div
class="fui-legend__text"
>
Metadata3
Supported Builds
</div>
</button>
</div>
Expand Down Expand Up @@ -946,79 +946,79 @@ exports[`Vertical stacked bar chart - Screen resolution Should remain unchanged
style="text-align: unset;"
>
<button
aria-label="Supported Builds"
aria-label="Metadata1"
aria-selected="false"
class="fui-Button fui-legend__legend"
data-overflow-item=""
role="option"
style="--rect-height: 4px; --rect-backgroundColor: #0078d4; --rect-borderColor: #0078d4;"
style="--rect-height: 12px; --rect-backgroundColor: #0078d4; --rect-borderColor: #0078d4;"
type="button"
>
<div
class="fui-legend__rect"
style="height: 4px; background-color: rgb(0, 120, 212); border-color: #0078d4; --rect-content-high-contrast: linear-gradient(to right, #0078d4, #0078d4);"
style="height: 12px; background-color: rgb(0, 120, 212); border-color: #0078d4; --rect-content-high-contrast: linear-gradient(to right, #0078d4, #0078d4);"
/>
<div
class="fui-legend__text"
>
Supported Builds
Metadata1
</div>
</button>
<button
aria-label="Metadata1"
aria-label="Metadata2"
aria-selected="false"
class="fui-Button fui-legend__legend"
data-overflow-item=""
role="option"
style="--rect-height: 12px; --rect-backgroundColor: #0078d4; --rect-borderColor: #0078d4;"
style="--rect-height: 12px; --rect-backgroundColor: #002050; --rect-borderColor: #002050;"
type="button"
>
<div
class="fui-legend__rect"
style="height: 12px; background-color: rgb(0, 120, 212); border-color: #0078d4; --rect-content-high-contrast: linear-gradient(to right, #0078d4, #0078d4);"
style="height: 12px; background-color: rgb(0, 32, 80); border-color: #002050; --rect-content-high-contrast: linear-gradient(to right, #002050, #002050);"
/>
<div
class="fui-legend__text"
>
Metadata1
Metadata2
</div>
</button>
<button
aria-label="Metadata2"
aria-label="Metadata3"
aria-selected="false"
class="fui-Button fui-legend__legend"
data-overflow-item=""
role="option"
style="--rect-height: 12px; --rect-backgroundColor: #002050; --rect-borderColor: #002050;"
style="--rect-height: 12px; --rect-backgroundColor: #00188f; --rect-borderColor: #00188f;"
type="button"
>
<div
class="fui-legend__rect"
style="height: 12px; background-color: rgb(0, 32, 80); border-color: #002050; --rect-content-high-contrast: linear-gradient(to right, #002050, #002050);"
style="height: 12px; background-color: rgb(0, 24, 143); border-color: #00188f; --rect-content-high-contrast: linear-gradient(to right, #00188f, #00188f);"
/>
<div
class="fui-legend__text"
>
Metadata2
Metadata3
</div>
</button>
<button
aria-label="Metadata3"
aria-label="Supported Builds"
aria-selected="false"
class="fui-Button fui-legend__legend"
data-overflow-item=""
role="option"
style="--rect-height: 12px; --rect-backgroundColor: #00188f; --rect-borderColor: #00188f;"
style="--rect-height: 4px; --rect-backgroundColor: #0078d4; --rect-borderColor: #0078d4;"
type="button"
>
<div
class="fui-legend__rect"
style="height: 12px; background-color: rgb(0, 24, 143); border-color: #00188f; --rect-content-high-contrast: linear-gradient(to right, #00188f, #00188f);"
style="height: 4px; background-color: rgb(0, 120, 212); border-color: #0078d4; --rect-content-high-contrast: linear-gradient(to right, #0078d4, #0078d4);"
/>
<div
class="fui-legend__text"
>
Metadata3
Supported Builds
</div>
</button>
</div>
Expand Down Expand Up @@ -3145,65 +3145,65 @@ exports[`VerticalStackedBarChart - mouse events Should render customized callout
class="fui-legend__legendContainer"
>
<button
aria-label="Line1"
aria-label="Metadata1"
aria-selected="false"
class="fui-Button fui-legend__legend"
role="option"
style="--rect-height: 4px; --rect-backgroundColor: yellow; --rect-borderColor: yellow;"
style="--rect-height: 12px; --rect-backgroundColor: aqua; --rect-borderColor: aqua;"
type="button"
>
<div
class="fui-legend__rect"
style="height: 4px; background-color: yellow; border-color: yellow; --rect-content-high-contrast: linear-gradient(to right, yellow, yellow);"
style="height: 12px; background-color: aqua; border-color: aqua; --rect-content-high-contrast: linear-gradient(to right, aqua, aqua);"
/>
<div
class="fui-legend__text"
>
Line1
Metadata1
</div>
</button>
</div>
<div
class="fui-legend__legendContainer"
>
<button
aria-label="Metadata1"
aria-label="Metadata2"
aria-selected="false"
class="fui-Button fui-legend__legend"
role="option"
style="--rect-height: 12px; --rect-backgroundColor: aqua; --rect-borderColor: aqua;"
style="--rect-height: 12px; --rect-backgroundColor: navy; --rect-borderColor: navy;"
type="button"
>
<div
class="fui-legend__rect"
style="height: 12px; background-color: aqua; border-color: aqua; --rect-content-high-contrast: linear-gradient(to right, aqua, aqua);"
style="height: 12px; background-color: navy; border-color: navy; --rect-content-high-contrast: linear-gradient(to right, navy, navy);"
/>
<div
class="fui-legend__text"
>
Metadata1
Metadata2
</div>
</button>
</div>
<div
class="fui-legend__legendContainer"
>
<button
aria-label="Metadata2"
aria-label="Line1"
aria-selected="false"
class="fui-Button fui-legend__legend"
role="option"
style="--rect-height: 12px; --rect-backgroundColor: navy; --rect-borderColor: navy;"
style="--rect-height: 4px; --rect-backgroundColor: yellow; --rect-borderColor: yellow;"
type="button"
>
<div
class="fui-legend__rect"
style="height: 12px; background-color: navy; border-color: navy; --rect-content-high-contrast: linear-gradient(to right, navy, navy);"
style="height: 4px; background-color: yellow; border-color: yellow; --rect-content-high-contrast: linear-gradient(to right, yellow, yellow);"
/>
<div
class="fui-legend__text"
>
Metadata2
Line1
</div>
</button>
</div>
Expand Down