如何根据c3图表中的数字更改工具提示标签?

时间:2017-07-23 15:32:30

标签: javascript c3.js

我想将工具提示标签显示为文本代替数字,我修复了六个字符串,如A = 1,B = 2,C = 3,D = 4,E = 5,E = 6。

我正在使用数字,因为我无法用文本字符串绘制图形,所以我使用的是1到6的数字。请帮助我。我在laravel5中使用c3图表。

以下是代码:

c3.generate({
        bindto: '#activity-user-grade-chart',
        size: {
            height: 240,
            width: 480
        },
        data: {
            x: 'x',
            xFormat: '%d-%m', // how the date is parsed
            type: 'bar',
            columns: [
                ['01-08','01-09','01-10','01-11'],
                [1,4,3,5]
            ]
        },
        color: {
            pattern: ['#FEBE29']
        },
        axis: {
            x: {
                type: 'timeseries',
                tick: {
                    format: '%d-%m' // how the date is displayed
                }
            }
        }
    }); 

预期的工具提示:

enter image description here

I want like this **Grade | A** in place of numeric value.

0 个答案:

没有答案