Files
learngo/logparser/oop/chartreport.go

39 lines
780 B
Go
Raw Normal View History

2019-08-17 15:55:25 +03:00
package main
2019-08-28 20:23:38 +03:00
// You need to run:
// go get -u github.com/wcharczuk/go-chart
// type chartReport struct {
// title string
// width, height int
2019-08-26 17:55:46 +03:00
// }
2019-08-28 20:23:38 +03:00
// func (s *chartReport) digest(records iterator) error {
// w := os.Stdout
2019-08-26 17:55:46 +03:00
// donut := chart.DonutChart{
2019-08-28 20:23:38 +03:00
// Title: s.title,
2019-08-26 17:55:46 +03:00
// TitleStyle: chart.Style{
// FontSize: 35,
// Show: true,
// FontColor: chart.ColorAlternateGreen,
// },
2019-08-28 20:23:38 +03:00
// Width: s.width,
// Height: s.height,
2019-08-26 17:55:46 +03:00
// }
2019-08-28 20:23:38 +03:00
// records.each(func(r record) {
2019-08-26 17:55:46 +03:00
// v := chart.Value{
// Label: r.domain + r.page + ": " + strconv.Itoa(r.visits),
// Value: float64(r.visits),
// Style: chart.Style{
// FontSize: 14,
// },
// }
// donut.Values = append(donut.Values, v)
2019-08-28 20:23:38 +03:00
// })
2019-08-26 17:55:46 +03:00
// return donut.Render(chart.SVG, w)
// }