Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
compendium-v2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
compendium-v2
Commits
bafc7d7c
Commit
bafc7d7c
authored
2 years ago
by
Bjarke Madsen
Browse files
Options
Downloads
Patches
Plain Diff
Use the ChartJS font config in generated legends
parent
b91f5cbe
No related branches found
No related tags found
1 merge request
!34
Rework to use a common font config across graphs and add x-axis and legends on top and bottom of graphs
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
webapp/src/components/DataPage.tsx
+3
-3
3 additions, 3 deletions
webapp/src/components/DataPage.tsx
webapp/src/plugins/HTMLLegendPlugin.ts
+5
-0
5 additions, 0 deletions
webapp/src/plugins/HTMLLegendPlugin.ts
with
8 additions
and
3 deletions
webapp/src/components/DataPage.tsx
+
3
−
3
View file @
bafc7d7c
...
@@ -9,9 +9,9 @@ import SectionNavigation from "./SectionNavigation";
...
@@ -9,9 +9,9 @@ import SectionNavigation from "./SectionNavigation";
import
{
Sections
}
from
"
../helpers/constants
"
;
import
{
Sections
}
from
"
../helpers/constants
"
;
import
PolicySidebar
from
"
./PolicySidebar
"
;
import
PolicySidebar
from
"
./PolicySidebar
"
;
import
{
Chart
as
ChartJS
}
from
'
chart.js
'
;
import
{
Chart
as
ChartJS
}
from
'
chart.js
'
;
ChartJS
.
defaults
.
font
.
size
=
1
8
;
ChartJS
.
defaults
.
font
.
size
=
1
6
;
ChartJS
.
defaults
.
font
.
family
=
'
Open Sans
'
;
ChartJS
.
defaults
.
font
.
family
=
'
Open Sans
'
;
ChartJS
.
defaults
.
font
.
weight
=
'
700
'
;
ChartJS
.
defaults
.
font
.
weight
=
'
700
'
;
...
@@ -23,7 +23,7 @@ interface inputProps {
...
@@ -23,7 +23,7 @@ interface inputProps {
category
:
Sections
category
:
Sections
}
}
function
DataPage
({
title
,
description
,
filter
,
children
,
category
}:
inputProps
):
ReactElement
{
function
DataPage
({
title
,
description
,
filter
,
children
,
category
}:
inputProps
):
ReactElement
{
return
(
return
(
<>
<>
{
category
===
Sections
.
Organisation
&&
<
OrganizationSidebar
/>
}
{
category
===
Sections
.
Organisation
&&
<
OrganizationSidebar
/>
}
...
...
This diff is collapsed.
Click to expand it.
webapp/src/plugins/HTMLLegendPlugin.ts
+
5
−
0
View file @
bafc7d7c
import
{
Chart
as
ChartJS
}
from
'
chart.js
'
;
const
getOrCreateLegendList
=
(
chart
,
id
)
=>
{
const
getOrCreateLegendList
=
(
chart
,
id
)
=>
{
const
legendContainer
=
document
.
getElementById
(
id
);
const
legendContainer
=
document
.
getElementById
(
id
);
if
(
!
legendContainer
)
{
if
(
!
legendContainer
)
{
...
@@ -72,6 +74,9 @@ const htmlLegendPlugin = {
...
@@ -72,6 +74,9 @@ const htmlLegendPlugin = {
textContainer
.
style
.
margin
=
'
0
'
;
textContainer
.
style
.
margin
=
'
0
'
;
textContainer
.
style
.
padding
=
'
0
'
;
textContainer
.
style
.
padding
=
'
0
'
;
textContainer
.
style
.
textDecoration
=
item
.
hidden
?
'
line-through
'
:
''
;
textContainer
.
style
.
textDecoration
=
item
.
hidden
?
'
line-through
'
:
''
;
textContainer
.
style
.
fontSize
=
`
${
ChartJS
.
defaults
.
font
.
size
}
px`
;
textContainer
.
style
.
fontFamily
=
`
${
ChartJS
.
defaults
.
font
.
family
}
`
;
textContainer
.
style
.
fontWeight
=
`
${
ChartJS
.
defaults
.
font
.
weight
}
`
;
const
text
=
document
.
createTextNode
(
item
.
text
);
const
text
=
document
.
createTextNode
(
item
.
text
);
textContainer
.
appendChild
(
text
);
textContainer
.
appendChild
(
text
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment