fix: fix font setting for title, #15
This commit is contained in:
parent
1713bc283f
commit
e095223705
4 changed files with 44 additions and 4 deletions
|
|
@ -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{
|
||||
"星期一",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue