Add Code to display Y-Axis Scale

Center the bar's labes
Add a screen shot for multi-graph
Update the readme.
This commit is contained in:
dhilipkumars
2015-04-27 20:27:11 -04:00
parent ae033ed3b4
commit 32027f061c
4 changed files with 51 additions and 9 deletions

View File

@@ -18,10 +18,10 @@ func main() {
termui.UseTheme("helloworld")
bc := termui.NewMBarChart()
math := []int{45, 75, 34, 62}
english := []int{50, 45, 25, 57}
science := []int{75, 60, 15, 50}
compsci := []int{90, 95, 100, 100}
math := []int{90, 85, 90, 80}
english := []int{70, 85, 75, 60}
science := []int{75, 60, 80, 85}
compsci := []int{100, 100, 100, 100}
bc.Data[0] = math
bc.Data[1] = english
bc.Data[2] = science
@@ -33,6 +33,8 @@ func main() {
bc.Y = 10
bc.BarWidth = 10
bc.DataLabels = studentsName
bc.ShowScale = true //Show y_axis scale value (min and max)
bc.SetMax(400)
bc.TextColor = termui.ColorGreen //this is color for label (x-axis)
bc.BarColor[3] = termui.ColorGreen //BarColor for computerscience

BIN
example/mbarchart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB