コード例 #1
0
ファイル: barchart.go プロジェクト: vron/plotinum
func (b *BarChart) Thumbnail(da *plot.DrawArea) {
	pts := []plot.Point{
		{da.Min.X, da.Min.Y},
		{da.Min.X, da.Max().Y},
		{da.Max().X, da.Max().Y},
		{da.Max().X, da.Min.Y},
	}
	poly := da.ClipPolygonY(pts)
	da.FillPolygon(b.Color, poly)

	pts = append(pts, plot.Point{da.Min.X, da.Min.Y})
	outline := da.ClipLinesY(pts)
	da.StrokeLines(b.LineStyle, outline...)
}
コード例 #2
0
ファイル: functions.go プロジェクト: vron/plotinum
// Thumbnail draws a line in the given style down the
// center of a DrawArea as a thumbnail representation
// of the LineStyle of the function.
func (f Function) Thumbnail(da *plot.DrawArea) {
	y := da.Center().Y
	da.StrokeLine2(f.LineStyle, da.Min.X, y, da.Max().X, y)
}
コード例 #3
0
ファイル: line.go プロジェクト: vron/plotinum
// Thumbnail the thumbnail for the Line,
// implementing the plot.Thumbnailer interface.
func (pts *Line) Thumbnail(da *plot.DrawArea) {
	y := da.Center().Y
	da.StrokeLine2(pts.LineStyle, da.Min.X, y, da.Max().X, y)
}