diff --git a/toGraph.go b/toGraph.go index da2d377..5e45744 100644 --- a/toGraph.go +++ b/toGraph.go @@ -19,7 +19,7 @@ var checkErr = func(err error) { // TODO: column names // TODO: graph name + output file name -// TODO: display columns +// TODO: statistic by columns func main() { state.InitState() diff --git a/toGraphTemplate.go b/toGraphTemplate.go index c4bc649..7294dde 100644 --- a/toGraphTemplate.go +++ b/toGraphTemplate.go @@ -63,6 +63,16 @@ const graphTemplate = ` }; chart.draw(data, options); + setColumnColors(); + } + + function setColumnColors() { + var legends = document.getElementsByClassName("legend-dot"); + var columns = document.getElementsByClassName("columnLabel"); + + for (let i = 0; i < columns.length; i++) { + columns[i].style.color = legends[i].style.backgroundColor; + } } function onChangeColumn(element) { @@ -81,7 +91,7 @@ const graphTemplate = `