0

使用 ng2-google-charts 和 angular 10 如何将数字格式化为百分比?

我使用“GeoChart”作为图表类型。

图表界面是

public geoChart: GoogleChartInterface = {
chartType: 'GeoChart',
dataTable: [
  ['Country', 'Issuance (2019)'],
  ['GB', 20]
],
formatters: [

  {
    columns: [1],
    type: 'NumberFormat',
    options: {
     suffix: '%'
    }
  }
],
4

1 回答 1

0

一个模式固定它

public geoChart: GoogleChartInterface = {
chartType: 'GeoChart',
dataTable: [
  ['Country', 'Issuance (2019)'],
  ['GB', 20]
],
formatters: [
  {
    columns: [1],
    type: 'NumberFormat',
    options: {
      pattern: '#0',
     suffix: '%'
    }
  }
],
于 2020-07-09T04:18:41.270 回答