[O] Use FormatUtils.limit

This commit is contained in:
Hykilpikonna
2019-10-20 20:26:18 -04:00
parent fec6c77dc2
commit 52626406bf
2 changed files with 4 additions and 2 deletions
@@ -99,7 +99,8 @@ export default class CourseScatter extends Vue
type: 'cross'
},
formatter: (ps: any[]) => ps[0].data[0] + '<br>' + ps.map(p =>
`${CourseScatter.DOT.replace('{color}', p.color)}${p.data[2]}: ${p.data[1]}<br>`).join('')
`${CourseScatter.DOT.replace('{color}', p.color)}
${FormatUtils.limit(p.data[2], 22)}: ${p.data[1]}<br>`).join('')
},
// Legend
+2 -1
View File
@@ -2,6 +2,7 @@ import {Component, Prop, Vue} from 'vue-property-decorator';
import {Course} from '@/components/app/app';
import {GPAUtils} from '@/utils/gpa-utils';
import Constants from '@/constants';
import {FormatUtils} from '@/utils/format-utils';
@Component({
})
@@ -40,7 +41,7 @@ export default class OverallBar extends Vue
rotate: 90,
// Truncate text length
formatter: (value: string) => value.length <= 16 ? value : value.substr(0, 14) + '...'
formatter: (value: string) => FormatUtils.limit(value, 16)
},
},