Commit c9b87750 authored by h2b's avatar h2b

Chart base line changed.

parent ea398396
......@@ -23,6 +23,9 @@ import de.h2b.scala.lib.simgraf.ColorIterator
/**
* A bar chart as shape.
*
* Each bar extends from `0` to `h` on the y axis, where `h` is its given
* height.
*
* Each bar is displayed in a different color ''excluding'' the active color.
*
* @constructor
......@@ -53,7 +56,7 @@ case class BarChart (val heights: Double*)
val colorIterator = ColorIterator(activeColor)
for (h heights) {
w.activeColor = colorIterator.next()
f(Point(x, wb), Point(x+barWidth, h))
f(Point(x, 0), Point(x+barWidth, h))
x += barWidth
}
w.activeColor = activeColor
......
......@@ -26,7 +26,7 @@ import de.h2b.scala.lib.simgraf.shapes._
object ChartDemo extends App {
private val p1 = Point(0,0)
private val p1 = Point(0,-30)
private val p2 = Point(100,100)
private val p0 = p1+(p2-p1)*0.5
......
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