Skip to content

Commit

Permalink
v0.31
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolainp committed Oct 27, 2023
1 parent 6b59fd2 commit 752dc6b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion toGraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
12 changes: 11 additions & 1 deletion toGraphTemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -81,7 +91,7 @@ const graphTemplate = `
<div class="dropdown-content">
{{range $i, $column := .Columns -}}
<input type="checkbox" name="{{$column}}" value="{{$i}}" onchange="onChangeColumn(this)" checked>
<label for="{{$column}}">{{$column}}</label><br>
<label class="columnLabel" for="{{$column}}">{{$column}}</label><br>
{{end}}
</div>
</div>
Expand Down

0 comments on commit 752dc6b

Please sign in to comment.