Commit 592e7231 authored by liming6's avatar liming6
Browse files

fix 修复timechart的bug

parent 0b52579d
......@@ -193,7 +193,7 @@ func (m *MyTimeChart) PutPoint(points []tchart.TimePoint) {
m.points.Add(points...)
}
m.RemoveUselessPoint()
threshold := time.Now().Add(time.Second * time.Duration(-2*m.width-1))
threshold := time.Now().Add(time.Second * time.Duration(-2*m.width))
points = m.points.Values()
tmpPoint := make([]tchart.TimePoint, 0, m.width*2)
// 判断是否需要补充空点
......@@ -237,7 +237,7 @@ func (m *MyTimeChart) ResetPutPoint(points []tchart.TimePoint) {
m.points.Add(points...)
}
m.RemoveUselessPoint()
threshold := time.Now().Add(time.Second * time.Duration(-2*m.width-1))
threshold := time.Now().Add(time.Second * time.Duration(-2*m.width))
points = m.points.Values()
tmpPoint := make([]tchart.TimePoint, 0, m.width*2)
......@@ -443,10 +443,10 @@ func (m *MyTimeChart) ViewWithMiddleLine() string {
for k, v := range resultLines {
if k == targetLine {
if isMiddle {
resultLines[k] = style.Foreground(m.color[k]).Strikethrough(true).Render(v)
resultLines[k] = style.Strikethrough(true).Foreground(m.color[k]).Render(v)
style.Strikethrough(false)
} else {
resultLines[k] = style.Foreground(m.color[k]).Underline(true).Render(v)
resultLines[k] = style.Underline(true).Foreground(m.color[k]).Render(v)
style.Underline(false)
}
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment