-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(chart): adiciona possibilidade de formatação do eixo de valor
O componente po-chart não realiza a formatação do milhares eixo de valor do gráfico, dificultando a visualização de grandes valores. Adiciona a propriedade labelType, que indica o tipo de formatação que deve ser aplicada ao eixo de valor do gráfico. Fixes #2358
- Loading branch information
1 parent
7d5d32a
commit 8709bc6
Showing
11 changed files
with
157 additions
and
13 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
projects/ui/src/lib/components/po-chart/enums/po-chart-label-format.enum.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* @usedBy PoChartComponent | ||
* | ||
* @description | ||
* | ||
* *Enum* `PoChartLabelFormat` para especificação dos tipos de formatação do eixo de valor no gráfico. | ||
*/ | ||
export enum PoChartLabelFormat { | ||
/** | ||
* Os valores serão exibidos no formato numérico com duas casas decimais. Equivalente ao formato `'1.2-2'` da [DecimalPipe](https://angular.io/api/common/DecimalPipe). | ||
*/ | ||
Number = 'number', | ||
|
||
/** | ||
* Os valores serão exibidos com o símbolo monetário de acordo com a formatação padrão da aplicação, isto é, o valor do token [DEFAULT_CURRENCY_CODE](https://angular.dev/api/core/DEFAULT_CURRENCY_CODE). Para adequar ao padrão numérico brasileiro, é necessário configurar o [LOCALE_ID](https://angular.dev/api/core/LOCALE_ID) da aplicação. A configuração pode ser feita da seguinte forma: | ||
* ``` | ||
* import { LOCALE_ID } from '@angular/core'; | ||
* import { registerLocaleData } from '@angular/common'; | ||
* import localePt from '@angular/common/locales/pt'; | ||
* | ||
* registerLocaleData(localePt); | ||
* | ||
* @NgModule({ | ||
* providers: [ | ||
* { provide: LOCALE_ID, useValue: 'pt-BR' }, | ||
* { provide: DEFAULT_CURRENCY_CODE, useValue: 'BRL' } | ||
* ] | ||
* }) | ||
* export class AppModule { } | ||
* ``` | ||
*/ | ||
Currency = 'currency' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters