我将 datePadding 插件用于 amCharts ,以便在轴上所有段之前和之后都有一些可用空间。它工作正常,但也会在滚动条上添加一些填充。
您可以在以下分支中看到问题:https://codepen.io/th3vic/pen/BEKGWo
var items = [{"category":"Finn Power E5","segments":[{"start":"2019-03-26 07:00:00","end":"2019-04-01 15:00:00","task":"Doza to check","color":"#cc4748"}]},{"category":"Amada 91","segments":[{"start":"2019-03-28 07:00:00","end":"2019-03-28 15:00:00","task":"Doza to check","color":"#cc4748"}]}];
var minimumDate ="2019-03-25 07:00:00"; var maximumDate="2019-04-02 15:00:00";
var chart = AmCharts.makeChart("chartdiv", {
"type": "gantt",
"theme": "light",
"marginRight": 70,
"period": "hh",
"dataDateFormat": "YYYY-MM-DD JJ:NN:SS",
"columnWidth": 0.5,
"valueAxis": {
"type": "date",
"minimumDate": minimumDate,
"maximumDate": maximumDate
},
"brightnessStep": 7,
"graph": {
"fillAlphas": 1,
"lineAlpha": 1,
"lineColor": "#fff",
"fillAlphas": 0.85,
"balloonText": "<b>[[task]]</b>:<br />[[open]] -- [[value]]"
},
"rotate": true,
"categoryField": "category",
"segmentsField": "segments",
"colorField": "color",
"startDateField": "start",
"endDateField": "end",
"dataProvider": items,
"valueScrollbar": {
"autoGridCount": true
},
"chartCursor": {
"cursorColor": "#55bb76",
"valueBalloonsEnabled": false,
"cursorAlpha": 0,
"valueLineAlpha": 0.5,
"valueLineBalloonEnabled": true,
"valueLineEnabled": true,
"zoomable": false,
"valueZoomable": true
},
"legend": {
"data": [{
"title": "Module #1",
"color": "#b9783f"
}, {
"title": "Module #2",
"color": "#cc4748"
}, {
"title": "Module #3",
"color": "#cd82ad"
}, {
"title": "Module #4",
"color": "#2f4074"
}, {
"title": "Module #5",
"color": "#448e4d"
}]
},
"export": {
"enabled": true
}
});
是否可以解决? (滚动条上没有填充)