example-9.fan 778 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using fwt
  2. using gfx
  3. using swtChartWrapper
  4. class Example9
  5. {
  6. public static Void main ()
  7. {
  8. // define the series of data points to display
  9. series1 := BarSeries
  10. {
  11. label = "bar series 1"
  12. points = [2.0f, 3.2f, 2.4f, 5.7f, 1.9f]
  13. }
  14. series2 := BarSeries
  15. {
  16. label = "bar series 2"
  17. points = [4.0f, 2.2f, 3.4f, 1.7f, 0.9f]
  18. color = Color.green
  19. }
  20. // define a window to display the chart in
  21. Window
  22. {
  23. title = "Example Chart"
  24. size = Size(450, 350)
  25. Chart
  26. {
  27. title.text = "Category Axis Example"
  28. xAxis.title.text = "Month"
  29. xAxis.categories = ["Mar", "Apr", "May", "Jun", "Jul"]
  30. yAxis.title.text = "Amplitude"
  31. data = [series1, series2]
  32. },
  33. }.open
  34. }
  35. }