Skip to content
Snippets Groups Projects
Commit 25f339bd authored by Lidia Matei's avatar Lidia Matei Committed by Yas Naoi
Browse files

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
(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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment