0

の合計帯域幅の結果を示す円グラフがありuplink/downlinkます。

現在、サフィックスは GB です。

ここに画像の説明を入力

私は彼らの接尾辞を異なって表示しようとして苦労しています。例、

  • ダウンリンクGB
  • のアップリンクKB

私は持っている

<script>

google.setOnLoadCallback(drawChart);
function drawChart() {

  console.log(color['downlink']);

  var data = google.visualization.arrayToDataTable([
    ['Task', 'Bandwith'],
    ['Downlink', ({{$t_down_bytes}})],
    ['Uplink', ({{$t_up_bytes}})]
  ]);

  var options = {
    legend: 'buttom',
    pieSliceText: 'value', // text | none
    title: 'Total Bandwith Usage',
    colors: [color['downlink'], color['uplink']],
    width:'100%',
    height: 400,
    slices: {
      1: {offset: 0.1}
    },

  };

  var formatter = new google.visualization.NumberFormat({
    fractionDigits:2,
    suffix: ' GB'
  });

  formatter.format(data, 1);

  var chart = new google.visualization.PieChart(document.getElementById('private'));
  chart.draw(data, options);
}

</script>

誰かがこれに光を当てることができます。

これに関するヒント/提案は大歓迎です!

4

1 に答える 1