Пример #1
0
func (b *QuartPlot) Plot(da plot.DrawArea, plt *plot.Plot) {
	trX, trY := plt.Transforms(&da)
	x := trX(b.Location)
	if !da.ContainsX(x) {
		return
	}
	x += b.Offset

	med := plot.Pt(x, trY(b.Median))
	q1 := trY(b.Quartile1)
	q3 := trY(b.Quartile3)
	aLow := trY(b.AdjLow)
	aHigh := trY(b.AdjHigh)

	da.StrokeLine2(b.WhiskerStyle, x, aHigh, x, q3)
	if da.ContainsY(med.Y) {
		da.DrawGlyphNoClip(b.MedianStyle, med)
	}
	da.StrokeLine2(b.WhiskerStyle, x, aLow, x, q1)

	ostyle := b.MedianStyle
	ostyle.Radius = b.MedianStyle.Radius / 2
	for _, out := range b.Outside {
		y := trY(b.Value(out))
		if da.ContainsY(y) {
			da.DrawGlyphNoClip(ostyle, plot.Pt(x, y))
		}
	}
}