Commit 2e6a3473 authored by h2b's avatar h2b

Chart demo adapted to new interface.

parent 7982f0d1
......@@ -22,6 +22,7 @@ import scala.util.Random
import de.h2b.scala.lib.simgraf.{ Color, Pixel, Point, Screen, World }
import de.h2b.scala.lib.simgraf.layout.GridLayout
import de.h2b.scala.lib.simgraf.Color._
import de.h2b.scala.lib.simgraf.shapes._
object ChartDemo extends App {
......@@ -41,32 +42,34 @@ object ChartDemo extends App {
private def newDefaultPieWorld (title: String) =
World(Rectangle(p1Pie, p2Pie))(next(), title)
private def colorSeq = Seq(Red, Green, Blue, Yellow, Cyan)
{
val world = newDefaultBarWorld("Bar Chart Drawed")
world.clear(Color.Black)
world.activeColor = Color.Black
world.draw(BarChart(30, 60, 20, 80, 50))
world.draw(BarChart(Seq(30, 60, 20, 80, 50), colorSeq))
}
{
val world = newDefaultBarWorld("Bar Chart Filled")
world.clear(Color.Black)
world.activeColor = Color.Black
world.fill(BarChart(30, 60, 20, 80, 50))
world.fill(BarChart(Seq(30, 60, 20, 80, 50), colorSeq))
}
{
val world = newDefaultPieWorld("Pie Chart Drawed")
world.clear(Color.Black)
world.activeColor = Color.Black
world.draw(PieChart(30, 60, 20, 80, 50))
world.draw(PieChart(Seq(30, 60, 20, 80, 50), colorSeq))
}
{
val world = newDefaultPieWorld("Pie Chart Filled")
world.clear(Color.Black)
world.activeColor = Color.Black
world.fill(PieChart(30, 60, 20, 80, 50))
world.fill(PieChart(Seq(30, 60, 20, 80, 50), colorSeq))
}
}
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