How to make a heatmap GUI?

If you know, some websites have heatmap in them, I think it’s a pretty cool way to see a player’s activity (and for them to see it as well).

How would I be able to achieve something like this?
image

An idea I had in mind was to use UI grid layout and fill the box colours according to the day when they played and how many minutes they spent on the game. Do you have any suggestions or ideas how this could work?

2 Likes

Maybe just add more ‘green’ when player is active. Something like this:

local playerActivity = {}

while wait(10) do
    day = day -- have a script that changes day ig
    playerActivity[day] = playerActivity[day] + 10 -- change the green color value
end

spawn(function()
    while wait(10) do
        local mondayBox = workspace.Monday
        local TuesdayBox = workspace.Tuesday

        local greenValue = playerActivity['monday']
        mondayBox.Color3.fromRGB(greenValue, 0, 0)
    end
end)

(havent tested this)

2 Likes

Yes, that’s the whole idea of making a heat map. I understand that concept, what I don’t quite get is the implementation to a script.

Can you tell me what your while loop is for?
Also what do you mean by the day variable?

So there is 2 while loop in the script I showed, the loop above it adds more color every 10 seconds so it basically updates it. The bottom one is assigning the changed green value. So Monday will be updated accordingly to the green value.

The day variable is just a another while loop that changes the day

while wait(100) do
    day = 'Monday'
    wait(100)
    day = 'Tuesday'
end

something like that. The script isn’t 100% working. I just made that up while writing the post. I’m just making a concept on how the script will probably look like.

This isn’t a day/night cycle or day/week cycle script. So there’s no need to use wait to make the day change. Because I’m referring to the actual day in the real world.

That script is only a demo on how it will probably work. It isn’t 100% what you want it is only a concept.

Yes, that concept doesn’t work either.

Then what concept will work…?

That’s the point of this whole thread. To find out what kind of code will work.

I just demonstrated how it could possibly work:

And this is what I said. It just won’t work. You giving me 5 lines of code that shows while wait loop doesn’t tell me anything?

Not only it isn’t 100% working, it won’t work at all. I don’t think the concept behind it will work either. So you have to describe it in more details if you still think it could work.

I already explained the code how it could possibly work. Updating the graph every 10 seconds.