Skip to content

Commit

Permalink
Vertical lines are colored with the data point color (minmatarfleet#978)
Browse files Browse the repository at this point in the history
  • Loading branch information
beautifulmim authored Dec 23, 2024
1 parent 2df9f30 commit 9c90ddb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
14 changes: 10 additions & 4 deletions frontend/app/src/components/blocks/CombatLogChart.astro
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import MultiRangeInput from '@components/blocks/MultiRangeInput.astro';
labels: this.timeline_time,
datasets: [
{
label: "${t('dps_taken')}",
label: "${t('damage_taken')}",
data: this.damage_in,
pointStyle: 'rect',
backgroundColor: '#b53620',
Expand All @@ -56,7 +56,7 @@ import MultiRangeInput from '@components/blocks/MultiRangeInput.astro';
}
},
{
label: "${t('dps_done')}",
label: "${t('damage_done')}",
data: this.damage_out,
pointStyle: 'rect',
backgroundColor: '#198754',
Expand Down Expand Up @@ -127,7 +127,13 @@ import MultiRangeInput from '@components/blocks/MultiRangeInput.astro';
ctx.save()
chart.data.datasets.forEach(dataset => {
const SHADE_COLOR = [
'rgba(181, 54, 32, 0.25)',
'rgba(25, 135, 84, 0.25)',
'rgba(32, 81, 181, 0.25)',
]
chart.data.datasets.forEach((dataset, dataset_index) => {
dataset.data.forEach((value, index) => {
const x = xScale.getPixelForValue(index)
const y = yScale.getPixelForValue(value)
Expand All @@ -136,7 +142,7 @@ import MultiRangeInput from '@components/blocks/MultiRangeInput.astro';
ctx.beginPath()
ctx.moveTo(x, y)
ctx.lineTo(x, yScale.getPixelForValue(0))
ctx.strokeStyle = 'rgba(241, 217, 160, 0.25)'
ctx.strokeStyle = SHADE_COLOR[dataset_index]
ctx.lineWidth = 1
ctx.stroke()
})
Expand Down
6 changes: 3 additions & 3 deletions frontend/app/src/i18n/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ export const ui = {
'damage': 'Damage',
'damage_taken': 'Damage taken',
'damage_done': 'Damage done',
'ticks_axis': 'Tick (events in 10 seconds spam)',
'ticks_axis': 'Time (10 second intervals)',
'fetch_contract_error': 'An error occurred while fetching contracts.',
'trade_hubs': 'trade hubs',
'trade_hub': 'trade hub',
Expand Down Expand Up @@ -1179,7 +1179,7 @@ export const ui = {
'post_url_copied': 'Post URL copied!',
'view_station_market_contracts': 'Contract service available on this station',
'damage_per_second': 'Damage per second',
'damage_reps_per_second': 'Damage per second / Repairs per second',
'damage_reps_per_second': 'Damage / repairs per second',
'dps_taken': 'DPS taken',
'dps_done': 'DPS done',
'per_volley': 'per volley',
Expand Down Expand Up @@ -1225,7 +1225,7 @@ export const ui = {
'repairs': 'Repairs',
'armor_repaired': 'Armor repaired',
'shield_repaired': 'Shield repaired',
'reps_done': 'RPS done',
'reps_done': 'Remote repairs',
'remote_boosters': 'Remote boosters',
'delete_log_error': 'An error occurred while deleting the log.',
'remove_log_dialog_title': 'Remove combat log',
Expand Down

0 comments on commit 9c90ddb

Please sign in to comment.