lfqian commited on
Commit
6fde1d1
·
1 Parent(s): d09e7ae

Remove date suffix from model names in chart tooltips

Browse files
Files changed (1) hide show
  1. src/components/CompareChartE.vue +5 -1
src/components/CompareChartE.vue CHANGED
@@ -187,6 +187,10 @@ export default defineComponent({
187
  },
188
  mounted(){ this.$nextTick(() => this.rebuild()) },
189
  methods: {
 
 
 
 
190
  async getAll(){
191
  let all = getAllDecisions() || []
192
  if (!all.length) {
@@ -277,7 +281,7 @@ export default defineComponent({
277
  : Number(v ?? 0).toLocaleString(undefined, { style: 'currency', currency: 'USD', maximumFractionDigits: 2 })
278
  return [
279
  `<div style="font-weight:600">${sel.agent_name}</div>`,
280
- sel.model ? `<div style="opacity:.8">${sel.model}</div>` : '',
281
  `<div style="opacity:.8">${sel.asset}</div>`,
282
  `<div style="margin-top:4px">${val}</div>`
283
  ].join('')
 
187
  },
188
  mounted(){ this.$nextTick(() => this.rebuild()) },
189
  methods: {
190
+ formatModelName(model) {
191
+ if (!model) return ''
192
+ return model.replace(/_?\d{8}$/, '')
193
+ },
194
  async getAll(){
195
  let all = getAllDecisions() || []
196
  if (!all.length) {
 
281
  : Number(v ?? 0).toLocaleString(undefined, { style: 'currency', currency: 'USD', maximumFractionDigits: 2 })
282
  return [
283
  `<div style="font-weight:600">${sel.agent_name}</div>`,
284
+ sel.model ? `<div style="opacity:.8">${this.formatModelName(sel.model)}</div>` : '',
285
  `<div style="opacity:.8">${sel.asset}</div>`,
286
  `<div style="margin-top:4px">${val}</div>`
287
  ].join('')