Skip to content

Commit

Permalink
Provides better output when it cannot plot the data.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariano Gappa committed Aug 5, 2018
1 parent 7885918 commit 32cce7c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cheatsheet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ func TestCheatsheet(t *testing.T) {
t.FailNow()
}
b, err := chartjs.New(
o.chartType.string(),
o.chartType.String(),
d.fss,
d.sss,
d.tss,
d.minFSS,
d.maxFSS,
o.title,
o.scaleType.string(),
o.scaleType.String(),
o.xLabel,
o.yLabel,
o.zeroBased,
Expand Down
2 changes: 1 addition & 1 deletion format/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (l LineFormat) String() string {
for _, c := range l.ColTypes {
bs = append(bs, c.String()...)
}
return fmt.Sprintf("{colTypes: [%v], separator: [%v], dateFormat: [%v]}", string(bs), string(l.Separator), l.DateFormat)
return string(bs)
}

func (c ColType) String() string {
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ func main() {
os.Exit(0)
}
b := chartjs.New(
opts.chartType.string(),
opts.chartType.String(),
dataset.fss,
dataset.sss,
dataset.tss,
dataset.minFSS,
dataset.maxFSS,
opts.title,
opts.scaleType.string(),
opts.scaleType.String(),
opts.xLabel,
opts.yLabel,
opts.zeroBased,
Expand Down
4 changes: 2 additions & 2 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ More info: https://github.com/marianogappa/chart`)
return o, nil
}

func (c chartType) string() string {
func (c chartType) String() string {
switch c {
case bar:
return "bar"
Expand All @@ -194,7 +194,7 @@ func (c chartType) string() string {
}
}

func (c scaleType) string() string {
func (c scaleType) String() string {
if c == logarithmic {
return "logarithmic"
}
Expand Down

0 comments on commit 32cce7c

Please sign in to comment.