fix lint warnings

This commit is contained in:
Vladimir Markelov 2015-12-11 15:43:11 -08:00
parent 23bf27ed03
commit 4fde52b5a3
1 changed files with 18 additions and 18 deletions

View File

@ -7,22 +7,23 @@ import (
) )
/* /*
BarChart is a chart that represents grouped data with SparkChart is a chart that represents a live data that
rectangular bars. It can be monochrome - defaut behavior. is continuously added to the chart. Or it can be static
One can assign individual color to each bar and even use element that displays predefined set of data - in this
custom drawn bars to display multicolored bars depending case it looks like BarChart. At a moment SparkChart
on bar value. keeps only th enumber of last data that is enough to
All bars have the same width: either constant BarSize - in fill the control area. So, if you enlarge the control,
case of AutoSize is false, or automatically calculated but it will show partially filled area until it gets new data.
cannot be less than BarSize. Bars that do not fit the chart SparkChart displays vertical axis with values on the chart left
area are not displayed. if ValueWidth greater than 0, horizontal axis with bar titles.
BarChart displays vertical axis with values on the chart left Maximum peaks(maximum of the the data that control keeps)
if ValueWidth greater than 0, horizontal axis with bar titles can be hilited with different color.
if ShowTitles is true (to enable displaying marks on horizontal By default the data is autoscaled to make the highest bar
axis, set ShowMarks to true), and chart legend on the right if fit the full height of the control. But it maybe useful
LegendWidth is greater than 3. to disable autoscale and set the Top value to have more
If LegendWidth is greater than half of the chart it is not handy diagram. E.g, for CPU load in % you can set
displayed. The same is applied to ValueWidth AutoScale to false and Top value to 100.
Note: negative and zero values are displayed as empty bar
*/ */
type SparkChart struct { type SparkChart struct {
ControlBase ControlBase
@ -201,9 +202,8 @@ func (b *SparkChart) calculateMultiplier() (float64, float64) {
if b.autosize || b.topValue == 0 { if b.autosize || b.topValue == 0 {
return float64(h) / max, max return float64(h) / max, max
} else {
return float64(h) / b.topValue, max
} }
return float64(h) / b.topValue, max
} }
// AddData appends a new bar to a chart // AddData appends a new bar to a chart