fix: fix font setting for title, #15

This commit is contained in:
vicanso 2022-07-27 20:27:49 +08:00
parent 1713bc283f
commit e095223705
4 changed files with 44 additions and 4 deletions

View file

@ -25,7 +25,8 @@ func writeFile(buf []byte) error {
func main() {
// 字体文件需要自行下载
buf, err := ioutil.ReadFile("../NotoSansSC.ttf")
// https://github.com/googlefonts/noto-cjk
buf, err := ioutil.ReadFile("./NotoSansSC.ttf")
if err != nil {
panic(err)
}
@ -83,7 +84,7 @@ func main() {
}
p, err := charts.LineRender(
values,
charts.TitleTextOptionFunc("Line"),
charts.TitleTextOptionFunc("测试"),
charts.FontFamilyOptionFunc("noto"),
charts.XAxisDataOptionFunc([]string{
"星期一",