Skip to content

Commit

Permalink
improve colors
Browse files Browse the repository at this point in the history
  • Loading branch information
bojand committed Aug 2, 2019
1 parent bac6a0c commit 17e42e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
1 change: 1 addition & 0 deletions web/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"dependencies": {
"@babel/runtime-corejs2": "^7.4.5",
"chart.js": "^2.8.0",
"chartjs-color": "^2.3.0",
"evergreen-ui": "^4.17.0",
"fuzzaldrin-plus": "^0.6.0",
"ky": "^0.11.1",
Expand Down
20 changes: 9 additions & 11 deletions web/ui/src/lib/projectChartData.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash'
import Chart from 'chart.js'
import color from 'chartjs-color'

import { colors } from './colors'
import { formatFloat } from './common'
Expand Down Expand Up @@ -104,15 +104,13 @@ function createLineChart (reports) {

const cubicInterpolationMode = 'monotone' // set to 'default' to get cubic
const lineTension = undefined // set to 0 to have straing lines
const borderWidth = 1.5
const pointRadius = 2

const color = Chart.helpers.color
const borderWidth = 1.75
const pointRadius = 1.75

const datasets = [
{
label: 'Average',
backgroundColor: color(colors.skyBlue).alpha(0.5).lighten(0.5).rgb(),
backgroundColor: color(colors.skyBlue).alpha(0.5).lighten(0.5).rgbString(),
borderColor: colors.blue,
fill: false,
data: avgData,
Expand All @@ -124,7 +122,7 @@ function createLineChart (reports) {
},
{
label: 'Fastest',
backgroundColor: color(colors.green).alpha(0.5).lighten(0.5).rgb(),
backgroundColor: color(colors.green).alpha(0.5).lighten(0.5).rgbString(),
borderColor: colors.green,
fill: false,
data: fastData,
Expand All @@ -136,7 +134,7 @@ function createLineChart (reports) {
},
{
label: 'Slowest',
backgroundColor: color(colors.red).alpha(0.5).lighten(0.5).rgb(),
backgroundColor: color(colors.red).alpha(0.5).lighten(0.5).rgbString(),
borderColor: colors.red,
fill: false,
data: slowData,
Expand All @@ -148,7 +146,7 @@ function createLineChart (reports) {
},
{
label: '95th',
backgroundColor: color(colors.orange).alpha(0.5).lighten(0.5).rgb(),
backgroundColor: color(colors.orange).alpha(0.5).lighten(0.5).rgbString(),
borderColor: colors.orange,
fill: false,
data: n5Data,
Expand All @@ -160,7 +158,7 @@ function createLineChart (reports) {
},
{
label: '99th',
backgroundColor: color(colors.purple).alpha(0.5).lighten(0.5).rgb(),
backgroundColor: color(colors.purple).alpha(0.5).lighten(0.5).rgbString(),
borderColor: colors.purple,
fill: false,
data: n9Data,
Expand All @@ -172,7 +170,7 @@ function createLineChart (reports) {
},
{
label: 'RPS',
backgroundColor: Color(colors.grey).alpha(0.5).lighten(0.5).rgb(),
backgroundColor: color(colors.grey).alpha(0.5).lighten(0.1).rgbString(),
borderColor: colors.grey,
fill: false,
data: rpsData,
Expand Down

0 comments on commit 17e42e4

Please sign in to comment.