【问题标题】:ng2-charts bar charts displaying values at the end of the barng2-charts 条形图在条形末尾显示值
【发布时间】:2017-04-27 23:55:13
【问题描述】:

我正在使用 ng2-charts 来显示非常基本的图表。我正在使用水平条形图,我需要在条形末尾显示值。我不知道该怎么做? See image

以下是我的 html 和选项:

 <canvas height="500" width="1000" baseChart 
            [data]="barChartData"
            [labels]="statusNames"
            [options]="barChartOptions"
            [colors]="chartColors"
            [legend]=false
            [chartType]="barChartType"
            (chartHover)="chartHovered($event)"
            (chartClick)="chartClicked($event)">
</canvas>


    public barChartOptions: any = {
    title: {
        display: true, text: 'Current Subject Status',
        fontSize: 20,
        color: "black"
    },
    scales: {
        xAxes: [{ 
             gridLines: { 
                          borderDash: [5], 
                          lineWidth: 1.4
                         }, 
             ticks: { beginAtZero: true} 
             }],
        yAxes: [{ 
                  barThickness: 20, 
                  gridLines: { display: false }
                }]
    },
    maintainAspectRatio: true,
    responsive: false
    };

    public barChartType: string = 'horizontalBar';
    public chartColors: any = [{ backgroundColor: "#005CA9" }];
    public barChartData: number[] = [3, 97 ,15, 13,63 ];

【问题讨论】:

标签: ng2-charts


【解决方案1】:

在 GitHub 上找到解决方案 Here

【讨论】:

    猜你喜欢
    • 2021-04-25
    • 2017-09-26
    • 1970-01-01
    • 2020-12-10
    • 1970-01-01
    • 1970-01-01
    • 2017-07-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多