example-5.fan 666 B

12345678910111213141516171819202122232425262728293031
  1. using fwt
  2. using gfx
  3. using swtChartWrapper
  4. class Example5
  5. {
  6. public static Void main ()
  7. {
  8. // define the series of data points to display
  9. series := LineSeries
  10. {
  11. label = "line series"
  12. points = [0.0f, 0.4f, 0.7f, 0.9f, 1.0f, 0.9f, 0.7f, 0.4f, 0.0f, -0.4f, -0.7f, -0.9f, -1.0f, -0.9f, -0.7f, -0.4f]
  13. enableStep = true
  14. }
  15. // define a window to display the chart in
  16. Window
  17. {
  18. title = "Example Chart"
  19. size = Size(450, 350)
  20. Chart
  21. {
  22. title.text = "Step Chart Example"
  23. xAxis.title.text = "Data Points"
  24. yAxis.title.text = "Amplitude"
  25. data = [series]
  26. },
  27. }.open
  28. }
  29. }