示例#1
0
func TestGenericWedge(t *testing.T) {
	g := initDemoCircle()
	s := chart.Style{Symbol: '#', FillColor: "#ff0000", LineColor: "#0000ff"}
	ra := math.Pi / 2

	chart.GenericWedge(g, 30, 20, r, ri, 0.15*ra, 0.5*ra, 1.5, s)
	fmt.Printf("\n%s\n", g.String())

	chart.GenericWedge(g, 30, 20, r, ri, 1.15*ra, 1.5*ra, 1.5, s)
	fmt.Printf("\n%s\n", g.String())

	chart.GenericWedge(g, 30, 20, r, ri, 2.15*ra, 2.5*ra, 1.5, s)
	fmt.Printf("\n%s\n", g.String())

	chart.GenericWedge(g, 30, 20, r, ri, 3.15*ra, 3.5*ra, 1.5, s)
	fmt.Printf("\n%s\n", g.String())

	// mored than one quadrant
	g = initDemoCircle()
	chart.GenericWedge(g, 30, 20, r, ri, 0.15*ra, 1.5*ra, 1.5, s)
	fmt.Printf("\n%s\n", g.String())

	chart.GenericWedge(g, 30, 20, r, ri, 2.15*ra, 3.5*ra, 1.5, s)
	fmt.Printf("\n%s\n", g.String())

	g = initDemoCircle()
	chart.GenericWedge(g, 30, 20, r, ri, 1.5*ra, 2.5*ra, 1.5, s)
	fmt.Printf("\n%s\n", g.String())

	// all 4 quadrants
	g = initDemoCircle()
	chart.GenericWedge(g, 30, 20, r, ri, 1.5*ra, 0.5*ra, 1.5, s)
	fmt.Printf("\n%s\n", g.String())

}
示例#2
0
文件: text.go 项目: haldean/chart
func (g *TextGraphics) Wedge(x, y, ro, ri int, phi, psi float64, style chart.Style) {
	chart.GenericWedge(g, x, y, ro, ri, phi, psi, CircleStretchFactor, style)
}