Signed-off-by: Markus Ressel <mail@markusressel.de>
This commit is contained in:
Markus Ressel 2024-10-13 02:58:23 +02:00
parent 2036aacbcb
commit ca09c00451
No known key found for this signature in database
GPG Key ID: F79626FAB2A3AACF

View File

@ -347,16 +347,20 @@ func (plot *Plot) drawXAxisLabelToScreen(
// if we omit the last gap, it fits, so we draw that before stopping
expectedLabelWidth--
labelWithoutGap := labelWithGap[:len(labelWithGap)-1]
tview.Print(screen, labelWithoutGap, initialOffset+labelStart, y+height-plotXAxisLabelsHeight, expectedLabelWidth, tview.AlignLeft, plot.axesLabelColor)
plot.printXAxisLabel(screen, labelWithoutGap, initialOffset+labelStart, y+height-plotXAxisLabelsHeight)
}
break
}
lastUsedLabelEnd = labelStart + expectedLabelWidth
tview.Print(screen, labelWithGap, initialOffset+labelStart, y+height-plotXAxisLabelsHeight, expectedLabelWidth, tview.AlignLeft, plot.axesLabelColor)
plot.printXAxisLabel(screen, labelWithGap, initialOffset+labelStart, y+height-plotXAxisLabelsHeight)
}
}
func (plot *Plot) printXAxisLabel(screen tcell.Screen, label string, x, y int) {
tview.Print(screen, label, x, y, len(label), tview.AlignLeft, plot.axesLabelColor)
}
func (plot *Plot) drawYAxisLabelToScreen(screen tcell.Screen, plotYAxisLabelsWidth int, x int, y int, height int) {
verticalOffset := plot.minVal
verticalScale := (plot.maxVal - plot.minVal) / float64(height-plotXAxisLabelsHeight-1)