Reputation: 11
I want to draw a vertical line representing the current date on my gantt chart. Please help me.
I found this answer
but it works only in amcharts 4.
Upvotes: 0
Views: 248
Reputation: 11
I found an answer to my own question:
inside the ready function we put:
function createRange(value) {
var rangeDataItem = xAxis.makeDataItem({
value: new Date('2023-02-04').getTime(),
above: true
});
var range = xAxis.createAxisRange(rangeDataItem);
rangeDataItem.get("grid").set("visible", true);
range.get("grid").setAll({
stroke: 'red',
strokeOpacity: 1,
width: 32,
location: 1
});
range.get("label").setAll({
fill: am5.color(0xffffff),
text: '05/02',
background: am5.RoundedRectangle.new(root, {
fill: '#aaa'
})
});
}
createRange();
it might solvemy own question hahahaha. 🤦♂️
Upvotes: 1