This commit is contained in:
NoryiE
2025-10-29 16:56:08 +00:00
parent 9a5b46138e
commit 00a9ce5632
26 changed files with 812 additions and 77 deletions

View File

@@ -2,3 +2,64 @@
_A data visualization element that represents numeric data through vertical bars. Each bar's height corresponds to its value, making it ideal for comparing quantities across categories or showing data changes over time. Supports multiple data series with customizable colors and styles._
Extends: `Graph`
## Usage
```lua run
-- Create a bar chart
```
```lua run
local chart = main:addBarChart()
```
```lua run
```
```lua run
-- Add two data series with different colors
```
```lua run
chart:addSeries("input", " ", colors.green, colors.green, 5)
```
```lua run
chart:addSeries("output", " ", colors.red, colors.red, 5)
```
```lua run
```
```lua run
-- Continuously update the chart with random data
```
```lua run
basalt.schedule(function()
```
```lua run
while true do
```
```lua run
chart:addPoint("input", math.random(1,100))
```
```lua run
chart:addPoint("output", math.random(1,100))
```
```lua run
sleep(2)
```
```lua run
end
```
```lua run
end)
```