trial-2.fan 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using fwt
  2. using gfx
  3. using swtChartWrapper
  4. class Trial2
  5. {
  6. public static Void main ()
  7. {
  8. // define the series of data points to display
  9. series := BarSeries
  10. {
  11. label = "bar series"
  12. points = [0.0f, 0.2f, 0.4f, 0.7f, 0.9f, 1.0f, 0.9f, 0.7f, 0.4f]
  13. color = Color.green
  14. padding = 0
  15. }
  16. // define a window to display the chart in
  17. Window
  18. {
  19. title = "Example Chart"
  20. size = Size(650, 350)
  21. Chart
  22. {
  23. title.text = "Sideways, Colourful, Bar Chart Example"
  24. title.font = Font { size = 25; name = "Arial" }
  25. xAxis.with
  26. {
  27. title.text = "Data Points"
  28. tick.foreground = Color.blue
  29. }
  30. yAxis.with
  31. {
  32. title.text = "Amplitude"
  33. tick.font = Font { size = 15; name = "Arial" }
  34. tick.labelAngle = 45
  35. }
  36. orientation = Orientation.vertical
  37. background = Color.fromStr("#88AA00")
  38. plotBackground = Color.yellow
  39. data = [series]
  40. // make some adjustments to the legend
  41. legend.with
  42. {
  43. foreground = Color.red
  44. background = Color.yellow
  45. position = Position.bottom
  46. }
  47. },
  48. }.open
  49. }
  50. }