gizak / termui

Golang terminal dashboard
MIT License
13.06k stars 783 forks source link

is x axis using assuming input array index is input value? #279

Closed fxfactorial closed 2 years ago

fxfactorial commented 3 years ago

Great lib -

So I want to make a plot like

and you'll see that the x axis is not starting at 0

from what i see in these examples and what i tried, the x axis is the index of the array. I want to do the braille style and i have this so far Screenshot from 2020-09-28 13-53-39

but the x axis still wrong, starting from 0 . Can you show an example somewhat approximating the initial graph i showed?

EDIT: and it was referenced here too: https://github.com/gizak/termui/pull/78#issuecomment-636241432

so I tried all the examples in plot.go and none are able to have the x axis not start from 0 -

fxfactorial commented 3 years ago

so it seems there is no way to not have a 0 origin

    buf.SetString(
        "0",
        NewStyle(ColorWhite),
        image.Pt(self.Inner.Min.X+yAxisLabelsWidth, self.Inner.Max.Y-1),
    )
JourneyToSilius commented 3 years ago

Is this going to be ever fixed ? Or is this project dead ? I'm having the same issue and I have invested quite a bit of time setting up this. There is no way to select for the starting point to be the smallest value in the array, which renders plotting close to useless. Did you fix this yourself ? Or just decided to move on and use some other library ?

fxfactorial commented 3 years ago

I moved on - project seems a bit stalled

JourneyToSilius commented 3 years ago

what did you ended up using ? thanks

fxfactorial commented 3 years ago

Nothing - just moved on =/