Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 1.23 KB

README.md

File metadata and controls

51 lines (37 loc) · 1.23 KB

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.

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

To Do

  • Dynamic chart example
  • Develop BubbleTea component

Thanks

Image was created with gopher-stickers.

This repo was inspired by termgraph.