"googlemock/git@developer.sourcefind.cn:yangql/googletest.git" did not exist on "d81b6a0c4cecbe087fae28bd6a3a40d1f5f45df4"
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) { ...@@ -193,7 +193,7 @@ func (m *MyTimeChart) PutPoint(points []tchart.TimePoint) {
m.points.Add(points...) m.points.Add(points...)
} }
m.RemoveUselessPoint() 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() points = m.points.Values()
tmpPoint := make([]tchart.TimePoint, 0, m.width*2) tmpPoint := make([]tchart.TimePoint, 0, m.width*2)
// 判断是否需要补充空点 // 判断是否需要补充空点
...@@ -237,7 +237,7 @@ func (m *MyTimeChart) ResetPutPoint(points []tchart.TimePoint) { ...@@ -237,7 +237,7 @@ func (m *MyTimeChart) ResetPutPoint(points []tchart.TimePoint) {
m.points.Add(points...) m.points.Add(points...)
} }
m.RemoveUselessPoint() 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() points = m.points.Values()
tmpPoint := make([]tchart.TimePoint, 0, m.width*2) tmpPoint := make([]tchart.TimePoint, 0, m.width*2)
...@@ -443,10 +443,10 @@ func (m *MyTimeChart) ViewWithMiddleLine() string { ...@@ -443,10 +443,10 @@ func (m *MyTimeChart) ViewWithMiddleLine() string {
for k, v := range resultLines { for k, v := range resultLines {
if k == targetLine { if k == targetLine {
if isMiddle { 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) style.Strikethrough(false)
} else { } 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) style.Underline(false)
} }
} else { } 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