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
8438280a
Commit
8438280a
authored
2 years ago
by
Bjarke Madsen
Browse files
Options
Downloads
Patches
Plain Diff
Add scale fix to staff graph
parent
ff4a01e7
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
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
webapp/src/pages/StaffGraph.tsx
+21
-3
21 additions, 3 deletions
webapp/src/pages/StaffGraph.tsx
with
21 additions
and
3 deletions
webapp/src/pages/StaffGraph.tsx
+
21
−
3
View file @
8438280a
...
...
@@ -46,7 +46,6 @@ const chartOptions = {
},
},
scales
:
{
x
:
{
position
:
'
top
'
as const
,
...
...
@@ -61,14 +60,33 @@ const chartOptions = {
ticks
:
{
callback
:
(
value
:
string
|
number
)
=>
{
if
(
typeof
value
===
'
number
'
)
{
return
`
${
value
*
100
}
%`
;
return
`
${
value
}
%`
;
}
return
value
;
},
},
grid
:
{
drawOnChartArea
:
false
}
},
afterDataLimits
:
function
(
axis
)
{
const
indices
=
Object
.
keys
(
ChartJS
.
instances
)
// initial values should be far outside possible range
let
max
=
-
999999
let
min
=
999999
for
(
const
index
of
indices
)
{
if
(
ChartJS
.
instances
[
index
]
&&
axis
.
chart
.
scales
.
x2
)
{
min
=
Math
.
min
(
ChartJS
.
instances
[
index
].
scales
.
x
.
min
,
min
);
max
=
Math
.
max
(
ChartJS
.
instances
[
index
].
scales
.
x
.
max
,
max
);
}
}
axis
.
chart
.
scales
.
x2
.
options
.
min
=
min
;
axis
.
chart
.
scales
.
x2
.
options
.
max
=
max
;
axis
.
chart
.
scales
.
x2
.
min
=
min
;
axis
.
chart
.
scales
.
x2
.
max
=
max
;
},
},
y
:
{
stacked
:
true
,
...
...
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