Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjusts stack chart color, tooltip position #144

Merged
merged 1 commit into from
May 5, 2020
Merged
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
6 changes: 3 additions & 3 deletions src/ChartTemplates/StackChart/StackChartTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import './_StackChartTemplate.scss';
import { Chart, ChartAxis, ChartBar, ChartLegend, ChartStack, ChartTooltip } from '@patternfly/react-charts';
import {
c_button_m_control_active_after_BorderBottomColor,
global_palette_gold_300,
global_palette_gold_200,
global_palette_gold_400,
global_palette_orange_300,
global_palette_red_200
Expand All @@ -20,11 +20,11 @@ export const StackChart = ({ ...props }) => {
global_palette_red_200.value,
global_palette_orange_300.value,
global_palette_gold_400.value,
global_palette_gold_300.value
global_palette_gold_200.value
];
const barWidth = 25;
const chartLegendFontSize = 12;
const labelComponent = () => <ChartTooltip text={ ({ datum }) => `${capitalize(datum.name)}: ${datum.y}` } constrainToVisibleArea />;
const labelComponent = () => <ChartTooltip dx={ -30 } orientation='top' text={ ({ datum }) => `${capitalize(datum.name)}: ${datum.y}` } />;
const legendData = props.data.map(item => ({ name: `${item.y} ${capitalize(item.name)}`, symbol: { type: null } }));
const stackChartPadding = { bottom: 0, left: 0, right: 0, top: 0 };

Expand Down