Let's say we have a simple Gantt chart, implemented in JavaScript, using AnyChart library:
If the user clicks on Tuesday row, it's automatically highlighted:
Is it possible to do it programatically? I mean, I don't want the user to click on a row, I want to do it with code.
AnyChart provides a wonderful playground to test the library. I created one to have a starting point: Select a row programatically. In the JavaScript code, search for the selectRow
function, and do your magic.
function selectRow() {
const idToSelect = "3";
const selected = treeData.search("id", idToSelect);
// highlight selected item
}
To achieve that you should apply true
to the selected
field of the item meta. For details, check the sample.