1package main
2
3import (
4	"fmt"
5)
6
7func showDebug(ls []string, d dataset, o options, lf string) {
8	fcn, scn, tcn, rn := 0, 0, 0, 0
9	if len(d.fss) > 0 {
10		rn = len(d.fss)
11		fcn = len(d.fss[0])
12	}
13	if len(d.sss) > 0 {
14		rn = len(d.sss)
15		scn = len(d.sss[0])
16	}
17	if len(d.tss) > 0 {
18		rn = len(d.tss)
19		tcn = len(d.tss[0])
20	}
21	fmt.Printf("Lines read\t%v\n", len(ls))
22	fmt.Printf("Line format inferred\t%v\n", lf)
23	fmt.Printf("Lines used\t%v\n", rn)
24	fmt.Printf("Float column count\t%v\n", fcn)
25	fmt.Printf("String column count\t%v\n", scn)
26	fmt.Printf("Date/Time column count\t%v\n", tcn)
27
28	if o.title != "" {
29		fmt.Printf("Chart title\t%v\n", o.title)
30	}
31	if o.xLabel != "" {
32		fmt.Printf("Chart horizontal axis label\t%v\n", o.xLabel)
33	}
34	if o.yLabel != "" {
35		fmt.Printf("Chart vertical axis label\t%v\n", o.yLabel)
36	}
37	if o.dateFormat != "" {
38		fmt.Printf("Date format\t%v\n", o.dateFormat)
39	}
40	switch o.chartType {
41	case pie:
42		fmt.Println("Chart type\tpie")
43	case bar:
44		fmt.Println("Chart type\tbar")
45	case line:
46		fmt.Println("Chart type\tline")
47	case scatter:
48		fmt.Println("Chart type\tscatter")
49	default:
50		fallthrough
51	case undefinedChartType:
52		fmt.Println("Chart type\t???")
53	}
54	switch o.scaleType {
55	case linear:
56		fmt.Println("Scale type\tlinear")
57	case logarithmic:
58		fmt.Println("Scale type\tlogarithmic")
59	}
60	switch o.separator {
61	case '\t':
62		fmt.Printf("Separator\t[tab]\n")
63	case ' ':
64		fmt.Printf("Separator\t[space]\n")
65	case ',':
66		fmt.Printf("Separator\t[comma]\n")
67	case ';':
68		fmt.Printf("Separator\t[semicolon]\n")
69	}
70}
71