Skip to content

Commit

Permalink
[Course statistics] Use same colors in both pass rate charts
Browse files Browse the repository at this point in the history
  • Loading branch information
rikurauhala committed Oct 14, 2024
1 parent af6cc53 commit e206e2b
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ exporting(ReactHighcharts.Highcharts)
exportData(ReactHighcharts.Highcharts)
accessibility(ReactHighcharts.Highcharts)

const colorsRelative = [color.green, color.red, chartColor.redLight]
const colors = [chartColor.blue, ...colorsRelative]

const passRateAttemptGraphOptions = (isRelative: boolean, categories: string[], max: number, title: string) => ({
chart: {
type: 'column',
},
colors: isRelative
? [color.green, color.red, chartColor.redLight]
: [chartColor.blue, color.green, color.red, chartColor.redLight],
colors: isRelative ? colorsRelative : colors,
credits: {
enabled: false,
},
Expand Down Expand Up @@ -55,9 +56,7 @@ const passRateStudentGraphOptions = (isRelative: boolean, categories: string[],
chart: {
type: 'column',
},
colors: isRelative
? [chartColor.greenDark, chartColor.redDark, chartColor.redLight]
: [chartColor.blue, chartColor.greenDark, chartColor.redDark, chartColor.redLight],
colors: isRelative ? colorsRelative : colors,
credits: {
enabled: false,
},
Expand Down

0 comments on commit e206e2b

Please sign in to comment.