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

Styling and legend component #13430

Merged
merged 2 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions ui/app/components/clients/total-client-usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const BAR_COLOR_DEFAULT = ['#8AB1FF', '#1563FF'];
const BACKGROUND_BAR_COLOR = '#EBEEF2';

const AXES_MARGIN = { xLeft: 10, xDown: 290 }; // makes space for y-axis legend
const TRANSLATE = { none: 0, right: 10, down: -31 };
const TRANSLATE = { none: 0, right: 10, down: -30 };

export default class TotalClientUsage extends Component {
@tracked tooltipTarget = '';
Expand Down Expand Up @@ -72,7 +72,7 @@ export default class TotalClientUsage extends Component {
chartSvg.attr('viewBox', `0 5 725 305`); // set aspect ratio

let groups = chartSvg
.selectAll('g')
.selectAll('g.rect')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably remove this - I don't think it made a difference and might mess with stuff later

.data(stackedData)
.enter()
.append('g')
Expand Down Expand Up @@ -110,6 +110,7 @@ export default class TotalClientUsage extends Component {
.append('g')
.attr('transform', `translate(${TRANSLATE.right})`)
.attr('class', 'axes-lines')
// .style('mix-blend-mode', 'darken')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can delete since we moved this to the CSS file

);

// customize x-axis
Expand Down
10 changes: 3 additions & 7 deletions ui/app/styles/core/charts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,6 @@
}
}

.chart {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just realize I'm going to need to keep this for my chart. But .axes-lines CSS can be used for the line chart, too

.tick > text {
font-weight: $font-weight-semibold;
font-size: $size-8;
}
}

.chart-column-left {
grid-column-start: 1;
grid-column-end: 4;
Expand Down Expand Up @@ -189,9 +182,12 @@
.axes-lines {
g > text {
color: $ui-gray-500;
font-weight: $font-weight-semibold;
font-size: $size-8;
}

g > line {
color: $ui-gray-300;
mix-blend-mode: darken;
}
}