Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cloud-3245650
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
cloud-3245650
Commits
25f339bd
Commit
25f339bd
authored
3 years ago
by
Lidia Matei
Committed by
Yas Naoi
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3231513
by XLD, yas: Fix K8s Node Allocated Resouces chart coloring
parent
efa812ed
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/cloud_service_providers/k8s/js/k8s_node_allocated_resources_chart.js
+16
-3
16 additions, 3 deletions
...ce_providers/k8s/js/k8s_node_allocated_resources_chart.js
with
16 additions
and
3 deletions
modules/cloud_service_providers/k8s/js/k8s_node_allocated_resources_chart.js
+
16
−
3
View file @
25f339bd
(
function
(
$
)
{
'
use strict
'
;
let
color
=
d3
.
interpolateSpectral
;
if
(
!
drupalSettings
.
k8s
||
!
drupalSettings
.
k8s
.
k8s_node_allocated_resources_chart_json_url
)
{
return
;
}
...
...
@@ -132,10 +131,16 @@
// Build chart.
$
(
'
#k8s_node_allocated_resources_chart
'
).
append
(
'
<div class="col-sm-9" style="float: none; margin: 0 auto"><canvas id="resource_chart"></canvas></div>
'
);
let
font_color
=
$
(
'
.panel-title
'
).
css
(
"
color
"
);
let
resource_ctx
=
document
.
getElementById
(
'
resource_chart
'
).
getContext
(
'
2d
'
);
let
resource_cfg
=
{
type
:
'
bar
'
,
options
:
{
legend
:
{
labels
:
{
fontColor
:
font_color
,
}
},
scales
:
{
xAxes
:
[{
type
:
'
time
'
,
...
...
@@ -149,13 +154,20 @@
bounds
:
'
ticks
'
,
ticks
:
{
source
:
'
ticks
'
,
autoSkip
:
false
autoSkip
:
false
,
fontColor
:
font_color
,
}
}],
yAxes
:
[{
scaleLabel
:
{
display
:
true
,
labelString
:
'
Resource Usage (%)
'
labelString
:
'
Resource Usage (%)
'
,
fontColor
:
font_color
,
},
ticks
:
{
source
:
'
ticks
'
,
autoSkip
:
false
,
fontColor
:
font_color
,
}
}]
},
...
...
@@ -180,6 +192,7 @@
};
let
resource_chart
=
new
Chart
(
resource_ctx
,
resource_cfg
);
console
.
log
(
resource_chart
);
initChart
();
...
...
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