diff --git a/README.md b/README.md index f6ece92..3b261a7 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,27 @@ $ seq 300 | awk 'BEGIN{OFS="\t"; print "x","sin(x)","cos(x)"}{x=$1/10; print x,s ## Installation +If you do not have a go enviroment prepared with the corresponding `GOPATH` +environment variable, you can run these command in Linux: + +```bash +mkdir $HOME/go + +echo 'export GOPATH=$HOME/go' >> $HOME/.bashrc +echo 'export PATH=$PATH:$GOPATH/bin' >> $HOME/.bashrc +``` + +Restart the session to have the new environment variables. + +With the go environment prepared, you have to run this command in order to +install termeter: + ```bash -$ go get github.com/atsaki/termeter/cmd/termeter +go get github.com/jentrialgo/termeter/cmd/termeter ``` +The command `termeter` should be in your path. + ## Input Data You can input data with stdin or file. @@ -33,13 +50,12 @@ You can input data with stdin or file. $ cat data.txt | termeter $ termeter data.txt ``` - termeter can accept tabular data like CSV. Delimiter character can be specified with option '-d DELIMITER'. Default is tab. ## Chart types -termeter supports following chart types. +termeter supports following chart types: * LINE * Plot values as line plot @@ -49,7 +65,7 @@ termeter supports following chart types. * Cumulative distribution function By default, termeter choose chart type automatically from second line of data. -If value is numeric LINE is choosed. Otherwise, COUNTER is choosed. +If value is numeric LINE is choosed. Otherwise, COUNTER is choosed. You can specify chart type with option ```-t TYPESTRING```. nth character of TYPESTRING corresponds to nth chart type. @@ -80,6 +96,14 @@ $ tail -f -n +7 dstat.log | termeter -d , +## Data labels + +You specify which data labels to use as X axis in line charts with the option `-L` and one of these options: + +* **count**: use the count of data. (Default) +* **first**: use the first column, i.e., the first value in the same line. +* **time**: use current time. + ## License MIT diff --git a/cmd/termeter/termeter.go b/cmd/termeter/termeter.go index 095b53e..7044175 100644 --- a/cmd/termeter/termeter.go +++ b/cmd/termeter/termeter.go @@ -135,7 +135,6 @@ func main() { if *dataLabelMode == "first" { labels = labels[1:] - record = record[1:] } types := make([]rune, len(labels), len(labels))