Files
learngo/interfaces/log-parser/oop/chartreport.go

39 lines
780 B
Go
Raw Normal View History

2019-08-17 15:55:25 +03:00
package main
2019-08-19 20:00:27 +03:00
// You need to run:
// go get -u github.com/wcharczuk/go-chart
2019-08-26 17:55:46 +03:00
// type chartReport struct {
// title string
// width, height int
// }
// func (s *chartReport) report(results iterator) error {
// w := os.Stdout
// donut := chart.DonutChart{
// Title: s.title,
// TitleStyle: chart.Style{
// FontSize: 35,
// Show: true,
// FontColor: chart.ColorAlternateGreen,
// },
// Width: s.width,
// Height: s.height,
// }
// results.each(func(r result) {
// 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)
// })
// return donut.Render(chart.SVG, w)
// }