go chartwriter

2026-08-30 浏览 (1)

chartwriter.go 源码

// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials  : https://learngoprogramming.com
// In-person training  : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus

package main

// func chartWriter(w io.Writer) outputFn {
// 	return func(res []result) error {
// 		return chartWrite(w, res)
// 	}
// }

// func chartWrite(w io.Writer, res []result) error {
// 	sort.Slice(res, func(i, j int) bool {
// 		return res[i].domain > res[j].domain
// 	})

// 	donut := chart.DonutChart{
// 		Title: "Total Visits Per Domain",
// 		TitleStyle: chart.Style{
// 			FontSize:  35,
// 			Show:      true,
// 			FontColor: chart.ColorAlternateGreen,
// 		},
// 		Width:  1920,
// 		Height: 800,
// 	}

// 	for _, r := range res {
// 		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)
// }

你可能感兴趣的文章

go textreader

go filters

go result

go field

go main

go pipeline

go groupers

go textwriter

  • 所属分类: 后端技术
  • 本文标签: golang
  • 版权声明: 本文链接 https://seaxiang.com/blog/NLlv9RIG