func ValueOfFloat(view qframe.FloatView) ValueFunc {
	return func(i int) float64 {
		return view.ItemAt(i)
	}
}
ValueOfFloat returns an FloatView compatible ValueFunc
package qplot
import (
	"strconv"
	"github.com/tobgu/qframe"
	"github.com/tobgu/qframe/qerrors"
	"github.com/tobgu/qframe/types"
)
type LabelFunc func(i int) string
func LabelOfString(view qframe.StringView) LabelFunc {
	return func(i int) string {
		return *view.ItemAt(i)
	}
}
func LabelOfEnum(view qframe.EnumView) LabelFunc {
	return func(i int) string {
		return *view.ItemAt(i)
	}
}
func LabelOfFloat(fmt byte, view qframe.FloatView) LabelFunc {
	return func(i int) string {
		return strconv.FormatFloat(view.ItemAt(i), fmt, -1, 64)
	}
}
func LabelOfInt(view qframe.IntView) LabelFunc {
	return func(i int) string {
		return strconv.FormatInt(int64(view.ItemAt(i)), 64)
	}
}
func LabelOfBool(view qframe.BoolView) LabelFunc {
	return func(i int) string {
		return strconv.FormatBool(view.ItemAt(i))
	}
}
type Labeller struct {
	len int
	fn  LabelFunc
}
func (l Labeller) Label(i int) string { return l.fn(i) }
func NewLabeller(len int, fn LabelFunc) Labeller {
	return Labeller{len: len, fn: fn}
}
type XYLabeller struct {
	Labeller
	XYer
}
type ValueFunc func(i int) float64
func NewValueFunc(col string, qf qframe.QFrame) (ValueFunc, error) {
	if !isNumCol(col, qf) {
		return nil, qerrors.New("NewValueFunc", "Column %s is not a numeric value", col)
	}
	if !qf.Contains(col) {
		return nil, qerrors.New("NewValueFunc", "QFrame does not contain column %s", col)
	}
	switch qf.ColumnTypeMap()[col] {
	case types.Int:
		return ValueOfInt(qf.MustIntView(col)), nil
	case types.Float:
		return ValueOfFloat(qf.MustFloatView(col)), nil
	default:
		panic(qerrors.New("NewValueFunc", "forgot to support a new column type?"))
	}
}
func MustNewValueFunc(col string, qf qframe.QFrame) ValueFunc {
	fn, err := NewValueFunc(col, qf)
	if err != nil {
		panic(qerrors.Propagate("MustNewValueFunc", err))
	}
	return fn
}
func ValueOfInt(view qframe.IntView) ValueFunc {
	return func(i int) float64 {
		return float64(view.ItemAt(i))
	}
}