相关疑难解决方法(0)

Chart.js 2.0使用货币和数千个分隔符格式化Y轴

我在格式化图表轴时遇到问题,我无法找到更新版本2.0的示例.

我怎么能(例如)2000000到€2.000.000?

我的小提琴:https://jsfiddle.net/Hiuxing/4sLxyfya/4/

window.onload = function() {
    var ctx = document.getElementById("canvas").getContext("2d");
    window.myBar = new Chart(ctx, {
        type: 'bar',
        data: barChartData,
        options: {
            title: {
                display:true,
                text:"Figure"
            },
            legend: {
                position: "bottom"
            },
            tooltips: {
                mode: 'label',
                bodySpacing: 10,
                cornerRadius: 0,
                titleMarginBottom: 15
            },
            scales: {
                xAxes: [{
                    ticks: {}
                }],
                yAxes: [{
                    ticks: {
                        beginAtZero: true,
                        stepSize: 500000
                    }
                }]
            },
            responsive: true
        }
    });
};
Run Code Online (Sandbox Code Playgroud)

javascript format jquery charts chart.js

11
推荐指数
2
解决办法
2万
查看次数

标签 统计

chart.js ×1

charts ×1

format ×1

javascript ×1

jquery ×1