小编Par*_*oxi的帖子

Chart.JS:如何使锐利的线条变得平滑的曲线

您好,我是图表新手,这是我的 ChartJS 图表,它当前正在工作,但它以锐线显示,我希望在此图表上使其曲线平滑。有任何想法吗?

function statistics(data) {
    if ($('#stats-currency').length > 0) {

        if (typeof(stats_currency) !== 'undefined') {
            stats_currency.destroy();
        }
        if (typeof(data) == 'undefined') {
            var currency = $('select[name="currency"]').val();
            $.get(admin_url + 'home/stats_currency/' + currency, function(response) {
                stats_currency = new Chart($('#stats-currency'), {
                    type: 'line',
                    data: response,
                    options: {
                        responsive:true,
                        scales: {
                            yAxes: [{
                              ticks: {
                                beginAtZero: true,
                            }
                        }]
                    },
                },
            });
            }, 'json');
        } else {
            stats_currency = new Chart($('#stats-currency'), {
                type: 'line',
                data: data,
                options: {
                    responsive: true,
                    scales: {
                        yAxes: …
Run Code Online (Sandbox Code Playgroud)

javascript charts chart.js

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

chart.js ×1

charts ×1

javascript ×1