Skip to content

Commit c08bdda

Browse files
committed
Update Graphs.JS
This update changes rendering of graph legend. Previously, our code relied on "graph lines" and "graph points" of different colors (the "points" were colored, while the connecting line was implicitly dark). An upstream change in Graphs.JS changed this, they now use the line color for legend fill area, which means that we will have a gray legend unless we make extra changes. And gray legend for two graphs of different colors is not really awesome. There are many possible ways of fixing this. After experimenting with this, I decided not to go the legend.labels.usePointStyle way, and instead I'm just tweaking several colors, line stroke widths and point diameters in a rather ad-hoc style. Well, it works; the key was really amking the orange a little bit darker and also ensuring that the orange stroke width is a wee bit wider. Change-Id: I720577800b7108a091d469f2e6801da522073305 Bug: chartjs/Chart.js#6644 Bug: chartjs/Chart.js#5621 Bug: chartjs/Chart.js#5375
1 parent 0860d58 commit c08bdda

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

sdn-roadm-add-drop/graphs.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,24 @@ const main = async () => {
100100
showLine: true,
101101
lineTension: 0,
102102
fill: false,
103-
borderWidth: 2,
104-
pointRadius: 1,
103+
borderWidth: 0.3,
104+
pointRadius: 2.0,
105105
pointHoverRadius: 1,
106106
backgroundColor: "teal",
107+
borderColor: "teal",
108+
pointBorderColor: "teal",
107109
},
108110
{
109111
label: "Express OUT",
110112
showLine: true,
111113
lineTension: 0,
112114
fill: false,
113-
borderWidth: 2,
114-
pointRadius: 1,
115+
borderWidth: 0.6,
116+
pointRadius: 2.0,
115117
pointHoverRadius: 1,
116-
backgroundColor: "orange",
118+
backgroundColor: "darkorange",
119+
borderColor: "orange",
120+
pointBorderColor: "darkorange",
117121
},
118122

119123
],

sdn-roadm-add-drop/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<html>
22
<head>
3-
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0"></script>
3+
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.3"></script>
44
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
5-
<script src="https://cdn.jsdelivr.net/npm/[email protected].4"></script>
5+
<script src="https://cdn.jsdelivr.net/npm/[email protected].5"></script>
66
<title>Add/Drop</title>
77
<style>
88
.error-message {

sdn-roadm-line/graphs.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,24 @@ const main = async () => {
100100
showLine: true,
101101
lineTension: 0,
102102
fill: false,
103-
borderWidth: 2,
104-
pointRadius: 1,
103+
borderWidth: 0.3,
104+
pointRadius: 2.0,
105105
pointHoverRadius: 1,
106106
backgroundColor: "blue",
107+
borderColor: "blue",
108+
pointBorderColor: "blue",
107109
},
108110
{
109111
label: "Line OUT",
110112
showLine: true,
111113
lineTension: 0,
112114
fill: false,
113-
borderWidth: 2,
114-
pointRadius: 1,
115+
borderWidth: 0.3,
116+
pointRadius: 2.0,
115117
pointHoverRadius: 1,
116118
backgroundColor: "red",
119+
borderColor: "red",
120+
pointBorderColor: "red",
117121
},
118122

119123
],

sdn-roadm-line/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<html>
22
<head>
3-
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0"></script>
3+
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.3"></script>
44
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
5-
<script src="https://cdn.jsdelivr.net/npm/[email protected].4"></script>
5+
<script src="https://cdn.jsdelivr.net/npm/[email protected].5"></script>
66
<title>Line/Degree</title>
77
<style>
88
.error-message {

0 commit comments

Comments
 (0)