Skip to content

Commit

Permalink
[Swap chart] Fix X-axis labels css (#836)
Browse files Browse the repository at this point in the history
* swap chart fix x axis labels css

* remove unused option
  • Loading branch information
Nikita-Polyakov authored Oct 17, 2022
1 parent 6639bda commit 9604257
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/components/Swap/Chart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,6 @@ export default class SwapChart extends Mixins(
return calcPriceChange(rangeClosePrice, rangeStartPrice);
}
get timeFormat(): string {
switch (this.selectedFilter.type) {
case SUBQUERY_TYPES.AssetSnapshotTypes.DAY:
return 'll';
default:
return 'LT';
}
}
get axisLabelCSS() {
return {
fontFamily: 'Sora',
Expand Down Expand Up @@ -437,7 +428,8 @@ export default class SwapChart extends Mixins(
const date = dayjs(+value);
const isNewDay = date.hour() === 0 && date.minute() === 0;
const isNewMonth = date.date() === 1 && isNewDay;
const timeFormat = isNewMonth ? 'MMMM' : isNewDay ? 'D' : 'LT';
// TODO: "LT" formatted labels (hours) sometimes overlaps (AM\PM issue)
const timeFormat = isNewMonth ? 'MMMM' : isNewDay ? 'D' : 'HH:mm';
const formatted = this.formatDate(+value, timeFormat);
if (isNewMonth) {
Expand All @@ -451,10 +443,12 @@ export default class SwapChart extends Mixins(
},
rich: {
monthStyle: {
fornWeight: 'bold',
fontSize: 10,
fontWeight: 'bold',
},
dateStyle: {
fornWeight: 'bold',
fontSize: 10,
fontWeight: 'bold',
},
},
color: this.theme.color.base.content.secondary,
Expand Down

0 comments on commit 9604257

Please sign in to comment.