This repository has been archived by the owner on Jun 11, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bar chart for performance stats. (#527)
* Toggle for Performance Stats. * Performance stats window comes & goes as setting is toggled. * tweaks. * Stopping point on Performance Stats work: piping to poll and store stats, put up buttons and viewer. * removing some files * Got label side of things working. * More proper includes. Rendering values. * respond to review * responded to review * reparenting gui to core gui instead of player. * pause * pausing * got parenting right so things lay on top of each other properly, parent is core gui. * spelling mistakes * spelling * graph is working * whassup * removed waits on requires. * responded to review from SolarCrane * respond to review * removing files. * cleaning up stupid Panel3d.lua file. * Fixmes on number formatting * respond to review
- Loading branch information
1 parent
0687a82
commit 74f2217
Showing
7 changed files
with
246 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
*~ | ||
|
||
*.gem | ||
*.rbc | ||
.bundle | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--[[ | ||
Filename: BarGraph.lua | ||
Written by: dbanks | ||
Description: A simple bar graph. | ||
--]] | ||
--[[ Services ]]-- | ||
local CoreGuiService = game:GetService('CoreGui') | ||
--[[ Globals ]]-- | ||
local BarColor = Color3.new(0.1, 0.7, 0.1) | ||
--[[ Modules ]]-- | ||
local StatsUtils = require(CoreGuiService.RobloxGui.Modules.Stats.StatsUtils) | ||
--[[ Classes ]]-- | ||
local BarGraphClass = {} | ||
BarGraphClass.__index = BarGraphClass | ||
function BarGraphClass.new() | ||
local self = {} | ||
setmetatable(self, BarGraphClass) | ||
self._frame = Instance.new("Frame") | ||
self._frame.Name = "PS_BarGraph" | ||
self._frame.BackgroundTransparency = 1.0 | ||
return self | ||
end | ||
function BarGraphClass:PlaceInParent(parent, size, position) | ||
self._frame.Position = position | ||
self._frame.Size = size | ||
self._frame.Parent = parent | ||
end | ||
function BarGraphClass:UpdateGraph(values, axisMax) | ||
self._frame:ClearAllChildren() | ||
local numValues = table.getn(values) | ||
for i, value in ipairs(values) do | ||
self:_addBar(i, value, numValues, axisMax) | ||
end | ||
end | ||
function BarGraphClass:_addBar(i, value, numValues, axisMax) | ||
local realIndex = i-1 | ||
local bar = Instance.new("Frame") | ||
bar.Name = string.format("Bar_%d", realIndex) | ||
bar.Position = UDim2.new(realIndex/numValues, 0, (axisMax - value)/axisMax, 0) | ||
bar.Size = UDim2.new(1/numValues, 0, value/axisMax, 0) | ||
bar.Parent = self._frame | ||
bar.BackgroundColor3 = BarColor | ||
bar.BorderSizePixel = 0 | ||
end | ||
return BarGraphClass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.