如何更改背景,边框半径,颜色的x轴数据?

时间:2020-06-15 14:42:07

标签: javascript charts chart.js linechart

我正在使用“ chart.js”插件制作图表。 我需要遵循这种设计。 enter image description here 但是,我找不到这样的例子。如何更改背景,边界半径,颜色的x轴数据?

                xAxes: [
                    {
                        id: 'xAxis1',
                        type: "category",
                        ticks: {
                            fontColor: '#9b9aa6',
                            fontSize: 11,
                            lineHeight: '17px',
                            callback: function (label) {
                                var month = label.split("-")[1];
                                var year = label.split("-")[0];
                                return month;
                            }
                        },
                        gridLines: {
                            display: false
                        },

                    },
                    {
                        id: 'xAxis2',
                        type: "category",
                        ticks: {
                            fontColor: '#737183',
                            fontSize: 11,
                            lineHeight: '17px',
                            callback: function (label) {
                                var month = label.split("-")[1];
                                var year = label.split("-")[0];
                                if (month === "25") { 
                                    return year;
                                } else if (month === "1") {
                                    return year;
                                } else {
                                    return "";
                                }
                            }
                        },
                        gridLines: {
                            display: false
                        },
                    }],

0 个答案:

没有答案
相关问题