Browse Source

Fix distorted tooltip

pull/1088/head
Thomas 3 years ago
parent
commit
ac4cb9926b
  1. 4
      apps/client/src/app/components/home-overview/home-overview.html
  2. 3
      apps/client/src/app/components/home-overview/home-overview.scss
  3. 1
      libs/ui/src/lib/line-chart/line-chart.component.html
  4. 1
      libs/ui/src/lib/line-chart/line-chart.component.ts

4
apps/client/src/app/components/home-overview/home-overview.html

@ -2,7 +2,8 @@
class="align-items-center container d-flex flex-column h-100 justify-content-center overview p-0 position-relative" class="align-items-center container d-flex flex-column h-100 justify-content-center overview p-0 position-relative"
> >
<div class="row w-100"> <div class="row w-100">
<div class="chart-container col"> <div class="col p-0">
<div class="chart-container mx-auto position-relative">
<gf-line-chart <gf-line-chart
class="position-absolute" class="position-absolute"
symbol="Performance" symbol="Performance"
@ -15,6 +16,7 @@
[showXAxis]="false" [showXAxis]="false"
[showYAxis]="false" [showYAxis]="false"
></gf-line-chart> ></gf-line-chart>
</div>
<div <div
*ngIf="hasPermissionToCreateOrder && historicalDataItems?.length === 0" *ngIf="hasPermissionToCreateOrder && historicalDataItems?.length === 0"
class="align-items-center d-flex h-100 justify-content-center w-100" class="align-items-center d-flex h-100 justify-content-center w-100"

3
apps/client/src/app/components/home-overview/home-overview.scss

@ -5,7 +5,8 @@
.chart-container { .chart-container {
aspect-ratio: 16 / 9; aspect-ratio: 16 / 9;
max-height: 50vh; height: auto;
max-width: 67rem;
// Fallback for aspect-ratio (using padding hack) // Fallback for aspect-ratio (using padding hack)
@supports not (aspect-ratio: 16 / 9) { @supports not (aspect-ratio: 16 / 9) {

1
libs/ui/src/lib/line-chart/line-chart.component.html

@ -8,6 +8,5 @@
></ngx-skeleton-loader> ></ngx-skeleton-loader>
<canvas <canvas
#chartCanvas #chartCanvas
class="h-100"
[ngStyle]="{ display: isLoading ? 'none' : 'block' }" [ngStyle]="{ display: isLoading ? 'none' : 'block' }"
></canvas> ></canvas>

1
libs/ui/src/lib/line-chart/line-chart.component.ts

@ -175,6 +175,7 @@ export class LineChartComponent implements AfterViewInit, OnChanges, OnDestroy {
data, data,
options: { options: {
animation: false, animation: false,
aspectRatio: 16 / 9,
elements: { elements: {
point: { point: {
hoverBackgroundColor: getBackgroundColor(), hoverBackgroundColor: getBackgroundColor(),

Loading…
Cancel
Save