example-1.fan 642 B

123456789101112131415161718192021222324252627282930
  1. using fwt
  2. using gfx
  3. using swtChartWrapper
  4. class Example1
  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. }
  14. // define a window to display the chart in
  15. Window
  16. {
  17. title = "Example Chart"
  18. size = Size(450, 350)
  19. Chart
  20. {
  21. title.text = "Line Chart Example"
  22. xAxis.title.text = "Data Points"
  23. yAxis.title.text = "Amplitude"
  24. data = [series]
  25. },
  26. }.open
  27. }
  28. }