|
|
@ -1,10 +1,7 @@ |
|
|
import { getTooltipOptions } from '@ghostfolio/common/chart-helper'; |
|
|
import { getTooltipOptions } from '@ghostfolio/common/chart-helper'; |
|
|
import { UNKNOWN_KEY } from '@ghostfolio/common/config'; |
|
|
import { UNKNOWN_KEY } from '@ghostfolio/common/config'; |
|
|
import { getLocale, getSum, getTextColor } from '@ghostfolio/common/helper'; |
|
|
import { getLocale, getSum, getTextColor } from '@ghostfolio/common/helper'; |
|
|
import { |
|
|
import { PortfolioPosition } from '@ghostfolio/common/interfaces'; |
|
|
AssetProfileIdentifier, |
|
|
|
|
|
PortfolioPosition |
|
|
|
|
|
} from '@ghostfolio/common/interfaces'; |
|
|
|
|
|
import { ColorScheme } from '@ghostfolio/common/types'; |
|
|
import { ColorScheme } from '@ghostfolio/common/types'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
@ -36,6 +33,8 @@ import Color from 'color'; |
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
import OpenColor from 'open-color'; |
|
|
import OpenColor from 'open-color'; |
|
|
|
|
|
|
|
|
|
|
|
import { PortfolioProportionChartClickEvent } from './interfaces/interfaces'; |
|
|
|
|
|
|
|
|
const { |
|
|
const { |
|
|
blue, |
|
|
blue, |
|
|
cyan, |
|
|
cyan, |
|
|
@ -80,7 +79,8 @@ export class GfPortfolioProportionChartComponent |
|
|
public chart: Chart<'doughnut'>; |
|
|
public chart: Chart<'doughnut'>; |
|
|
public isLoading = true; |
|
|
public isLoading = true; |
|
|
|
|
|
|
|
|
protected readonly proportionChartClicked = output<AssetProfileIdentifier>(); |
|
|
protected readonly proportionChartClicked = |
|
|
|
|
|
output<PortfolioProportionChartClickEvent>(); |
|
|
|
|
|
|
|
|
private readonly OTHER_KEY = 'OTHER'; |
|
|
private readonly OTHER_KEY = 'OTHER'; |
|
|
|
|
|
|
|
|
@ -355,11 +355,11 @@ export class GfPortfolioProportionChartComponent |
|
|
const dataIndex = activeElements[0].index; |
|
|
const dataIndex = activeElements[0].index; |
|
|
const symbol = chart.data.labels?.[dataIndex] as string; |
|
|
const symbol = chart.data.labels?.[dataIndex] as string; |
|
|
|
|
|
|
|
|
const dataSource = this.data[symbol].dataSource; |
|
|
const dataSource = this.data[symbol]?.dataSource; |
|
|
|
|
|
|
|
|
if (dataSource) { |
|
|
this.proportionChartClicked.emit( |
|
|
this.proportionChartClicked.emit({ dataSource, symbol }); |
|
|
dataSource ? { dataSource, symbol } : { accountId: symbol } |
|
|
} |
|
|
); |
|
|
} catch {} |
|
|
} catch {} |
|
|
}, |
|
|
}, |
|
|
onHover: (event, chartElement) => { |
|
|
onHover: (event, chartElement) => { |
|
|
|