Jimin Huang commited on
Commit
e6ecd2f
·
1 Parent(s): 12ec108

Change settings

Browse files
Files changed (1) hide show
  1. src/components/CompareChartE.vue +42 -16
src/components/CompareChartE.vue CHANGED
@@ -27,11 +27,11 @@ const ASSET_CUTOFF = {
27
  };
28
 
29
  const AGENT_COLOR_MAP = {
30
- HedgeFundAgent: '#6D4CFE',
31
- DeepFundAgent: '#FF6B6B',
32
- TradeAgent: '#10B981',
33
- InvestorAgent: '#F59E0B'
34
- }
35
 
36
  // pick color by agent name + index (from agentColorIndex map)
37
  function getAgentColor(agent, idx = 0) {
@@ -353,12 +353,17 @@ export default defineComponent({
353
  }
354
 
355
  this.option = {
 
 
356
  animation: true,
357
  locale: 'en',
358
- grid: { left: 64, right: 200, top: 8, bottom: 52 },
359
  tooltip: {
360
  trigger: 'axis',
361
  axisPointer: { type: 'line' },
 
 
 
 
362
  // NEW: format per mode
363
  valueFormatter: v => {
364
  if (typeof v !== 'number') return v
@@ -371,21 +376,27 @@ export default defineComponent({
371
  xAxis: {
372
  type: 'time',
373
  axisLabel: {
 
 
374
  formatter: (value) => {
375
  const date = new Date(value);
376
  return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
377
  }
378
- }
 
 
379
  },
380
- yAxis: this.mode === 'pct'
381
- ? {
382
- type: 'value', scale: true,
383
- axisLabel: { formatter: v => `${Number(v).toLocaleString(undefined, { maximumFractionDigits: 0 })}%` }
384
- }
385
- : {
386
- type: 'value', scale: true,
387
- axisLabel: { formatter: v => Number(v).toLocaleString(undefined, {style:'currency', currency:'USD', maximumFractionDigits:0 }) }
388
  },
 
 
389
  dataZoom: [{ type: 'inside', throttle: 50 }, { type: 'slider', height: 14, bottom: 36 }],
390
  series
391
  }
@@ -395,6 +406,21 @@ export default defineComponent({
395
  </script>
396
 
397
  <style scoped>
398
- .chart-wrap { width: 100%; }
 
 
 
 
 
 
 
 
399
  .h-96 { height: 24rem; }
 
 
 
 
 
 
 
400
  </style>
 
27
  };
28
 
29
  const AGENT_COLOR_MAP = {
30
+ HedgeFundAgent: '#3A0CA3', // violet-blue
31
+ DeepFundAgent: '#F72585', // magenta
32
+ TradeAgent: '#00BFA6', // teal
33
+ InvestorAgent: '#FFB703', // golden
34
+ };
35
 
36
  // pick color by agent name + index (from agentColorIndex map)
37
  function getAgentColor(agent, idx = 0) {
 
353
  }
354
 
355
  this.option = {
356
+ backgroundColor: 'transparent',
357
+ grid: { left: 60, right: 160, top: 20, bottom: 60 },
358
  animation: true,
359
  locale: 'en',
 
360
  tooltip: {
361
  trigger: 'axis',
362
  axisPointer: { type: 'line' },
363
+ backgroundColor: 'rgba(255,255,255,0.9)',
364
+ borderColor: 'rgba(0,0,0,0.1)',
365
+ textStyle: { color: '#111', fontWeight: 600, fontSize: 13 },
366
+ extraCssText: 'box-shadow: 0 4px 10px rgba(0,0,0,0.08); backdrop-filter: blur(6px);'
367
  // NEW: format per mode
368
  valueFormatter: v => {
369
  if (typeof v !== 'number') return v
 
376
  xAxis: {
377
  type: 'time',
378
  axisLabel: {
379
+ fontWeight: 600,
380
+ color: '#333',
381
  formatter: (value) => {
382
  const date = new Date(value);
383
  return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
384
  }
385
+ },
386
+ axisLine: { lineStyle: { color: 'rgba(0,0,0,0.2)' } },
387
+ splitLine: { show: false }
388
  },
389
+ yAxis: {
390
+ type: 'value',
391
+ scale: true,
392
+ axisLabel: {
393
+ color: '#444',
394
+ formatter: (v) => this.mode === 'pct'
395
+ ? `${v.toFixed(0)}%`
396
+ : v.toLocaleString(undefined, { style:'currency', currency:'USD', maximumFractionDigits:0 })
397
  },
398
+ splitLine: { lineStyle: { color: 'rgba(0,0,0,0.05)' } }
399
+ },
400
  dataZoom: [{ type: 'inside', throttle: 50 }, { type: 'slider', height: 14, bottom: 36 }],
401
  series
402
  }
 
406
  </script>
407
 
408
  <style scoped>
409
+ .chart-wrap {
410
+ width: 100%;
411
+ background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
412
+ border: 1px solid rgba(0,0,0,0.05);
413
+ border-radius: 16px;
414
+ box-shadow: 0 4px 16px rgba(0,0,0,0.04);
415
+ overflow: hidden;
416
+ padding: 10px;
417
+ }
418
  .h-96 { height: 24rem; }
419
+
420
+ :deep(.echarts-tooltip) {
421
+ font-family: 'Inter', sans-serif;
422
+ backdrop-filter: blur(8px);
423
+ border-radius: 8px;
424
+ border: 1px solid rgba(0,0,0,0.1);
425
+ }
426
  </style>