Google条形图-仅显示百分比值

时间:2020-01-14 14:40:25

标签: charts percentage absolute-value google-barchart

我希望有人可以帮助我制作我的Google条形图:

我试图更改百分比的绝对值,但是没有用。 我只想显示百分比值而不是绝对值。 当前两个值都显示。

我已经添加了 isStacked:'百分比', 到选项中,但这只会添加百分比值而不是替换它。

代码如下:

function drawBarChartCloudComputing() {
// Define the chart to be drawn.
var data = google.visualization.arrayToDataTable([
    ['Percentage','nutzen wir (in %)', 'Einsatz planen wir (in %)', 'nicht relevant (in %)', 'noch nicht mit dem Thema befasst', 'keine Angabe'],
    ['IKT',  59 , 4, 32, 3, 2],
    ['Handel',  49, 2, 35, 14, 0],
    ['Wissensintensive Dienstleister',  48, 2, 40, 10, 0],
    ['Finanz- und Versicherungsdienstleistungen',  39, 8, 30, 22, 1],
    ['Chemie / Pharma',  38, 8, 41, 13, 0],
    ['Sonstiges verarbeitendes Gewerbe',  35, 7, 40, 18, 0],
    ['Maschinenbau',  35, 15, 41, 9, 0],
    ['Gesundheitswesen',  32, 10, 44, 14, 0],
    ['Verkehr und Logistik',  31, 12, 40, 17, 0],
    ['Energie- und Wasserversorgung',  21, 8, 58, 12, 1],
    ['Fahrzeugbau',  21, 6, 56, 17, 0],
]);
var options = {
    chartArea: { width: '80%', height: '80%',},
    title: 'Cloud Computing 2018: Branchen.',
    fontFamily: 'Maven Pro',
    isStacked: true,
    isStacked: 'percent',
    backgroundColor: 'transparent',
    tooltip: {
        text: 'percentage'
    },
    legendTextStyle: {
        color: '#ffffff',
        fontFamily: 'Maven Pro',
    },
    pieSliceTextStyle: {
        color: '#ffffff'
    },
    titleTextStyle: {
        color: '#ffffff',
        fontFamily: 'Maven Pro',
        fontSize: 16,
    },
    colors: ['#FF8800', '#4187ff', '#80afff', '#bfd7ff', '#F2F7FF'],
    hAxis: {
        textStyle: {
            color: "#FFFFFF",
            fontFamily: 'Maven Pro',
            fontSize: 12,
            marginTop: 10,
        },
        gridlines: {
            color: 'transparent'
        },
        baselineColor: 'transparent'
    },
    vAxis: {
        textStyle: {
            color: "#FFFFFF",
            fontFamily: 'Maven Pro',
            fontSize: 14,
            direction: 10,
        },
        gridlines: {
            color: 'transparent'
        },
        baselineColor: 'transparent',
    }
};
}

0 个答案:

没有答案