Skip to content

Commit ddf7b8c

Browse files
committed
stockproduct: data, font tweaks
1 parent a7778b8 commit ddf7b8c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stockproduct/stockproduct.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (p *Parameters) barchart(location string, canvas *svg.SVG) {
8383
if bw < 2 {
8484
bw = 2
8585
}
86-
canvas.Text(p.x, p.y-halfoffset, sp.Title, "font-size:400%")
86+
canvas.Text(p.x, p.y-halfoffset, sp.Title, "font-size:300%")
8787
if p.showgrid {
8888
canvas.Gstyle("stroke:lightgray;stroke-width:1px")
8989
gx := p.x - (bw / 2)
@@ -107,7 +107,7 @@ func (p *Parameters) barchart(location string, canvas *svg.SVG) {
107107
}
108108
if p.showimage {
109109
if len(d.Image) > 0 {
110-
canvas.Image(p.x-bw/2, by-offset-2, bw, offset, d.Image)
110+
canvas.Image(p.x-bw/2, by-offset-p.fontsize, bw, offset, d.Image)
111111
}
112112
}
113113
canvas.Gstyle("stroke:none;fill:black")
@@ -121,7 +121,7 @@ func (p *Parameters) barchart(location string, canvas *svg.SVG) {
121121
}
122122
}
123123
if p.showprice {
124-
canvas.Text(p.x, by, fmt.Sprintf("%.2f", d.Price), "font-weight:bold")
124+
canvas.Text(p.x, by+p.fontsize, fmt.Sprintf("%.2f", d.Price), "font-size:150%;font-weight:bold")
125125
}
126126
if p.showdate {
127127
canvas.Text(p.x, bottom+20, d.Date)
@@ -166,7 +166,7 @@ func main() {
166166
canvas := svg.New(os.Stdout)
167167
canvas.Start(param.width, param.height)
168168
canvas.Rect(0, 0, width, height, canvas.RGB(255, 255, 255))
169-
canvas.Gstyle(fmt.Sprintf("font-family:Calibri;font-size:%dpx", param.fontsize))
169+
canvas.Gstyle(fmt.Sprintf("font-family:Calibri,sans-serif;font-size:%dpx", param.fontsize))
170170
if len(flag.Args()) == 0 {
171171
param.barchart("", canvas)
172172
} else {

0 commit comments

Comments
 (0)