:PlotHistogram

Preview
type Points = {
	[number]: number
}
type PlotHistogram = {
	Label: string?,
	Points: Points,
	Minimum: number?, // Otherwise automatic
	Maximum: number?, // Otherwise automatic
	GetBaseValues: (PlotHistogram) -> (number, number),
	UpdateGraph: (PlotHistogram) -> PlotHistogram,
	PlotGraph: (PlotHistogram, Points: Points) -> PlotHistogram,
	Plot: (PlotHistogram, Value: number) -> {
		SetValue: (Plot, Value: number) -> nil,
		GetPointIndex: (Plot) -> number,
		Remove: (Plot, Value: number) -> nil,
	},
}

Example usage:

:PlotHistogram({
    Points = {0.6, 0.1, 1.0, 0.5, 0.92, 0.1, 0.2}
})

--// With limited sizes
:PlotHistogram({
    Minimum = 0,
    Maximum = 1,
    Points = {0.6, 0.1, 1.0, 0.5, 0.92, 0.1, 0.2}
})

Last updated