https://github.com/bitcolibri/candleprintgo
Terminal candle chart in Go
https://github.com/bitcolibri/candleprintgo
candlestick-chart go golang terminal tui
Last synced: 5 months ago
JSON representation
Terminal candle chart in Go
- Host: GitHub
- URL: https://github.com/bitcolibri/candleprintgo
- Owner: BitColibri
- License: mit
- Created: 2023-05-20T18:43:44.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-24T08:37:20.000Z (almost 2 years ago)
- Last Synced: 2025-08-01T00:31:00.692Z (11 months ago)
- Topics: candlestick-chart, go, golang, terminal, tui
- Language: Go
- Homepage:
- Size: 96.7 KB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CandlePrintGo
CandlePrintGo is a small package that lets you print candle charts in the terminal.
## Features
* Color profile selection
* Simple use library
## Usage
Create a `CandleChart` passing an array of `Candle` and `height`.
```go
package main
import (
"fmt"
"github.com/bitcolibri/candlePrintGo"
"github.com/muesli/termenv"
)
func main() {
profile := candlePrintGo.NewColorProfile(termenv.ColorProfile(), "#A8CC8C", "#E88388")
data := []candlePrintGo.Candle{
candlePrintGo.NewCandleBar(255.49, 261.50, 253.42, 260.64),
candlePrintGo.NewCandleBar(257.89, 261.32, 253.50, 259.61),
candlePrintGo.NewCandleBar(258.14, 264.57, 257.13, 262.51),
candlePrintGo.NewCandleBar(262.26, 267.10, 261.42, 265.89),
}
chart := candlePrintGo.NewCandleChart(data, 50, candlePrintGo.WithColorProfile(profile))
fmt.Println(chart.Render())
}
```
Check the [example](examples/static/main.go)
## To Do
* Dynamic chart example
* Develop BubbleTea component
## Thanks
Image was created with [gopher-stickers](https://github.com/tenntenn/gopher-stickers).
This repo was inspired by [termgraph](https://github.com/sgeisler/termgraph).