Пример #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
func TestGenericWedge(t *testing.T) {
	g := initDemoCircle()
	red, blue := color.RGBA{0xff, 0, 0, 0}, color.RGBA{0, 0, 0xff, 0}
	s := chart.Style{Symbol: '#', FillColor: red, LineColor: blue}
	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())

}
Пример #3
0
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)
}