example-4.fan 768 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using fwt
  2. using gfx
  3. using swtChartWrapper
  4. class Example4
  5. {
  6. public static Void main ()
  7. {
  8. // define the series of data points to display
  9. series1 := LineSeries
  10. {
  11. label = "line series 1"
  12. points = [1.2f, 3.4f, 3.1f, 0.1f, 0.6f]
  13. enableArea = true
  14. }
  15. series2 := LineSeries
  16. {
  17. label = "line series 2"
  18. points = [0.1f, 0.3f, 0.7f, 1.5f, 2.6f]
  19. lineColor = Color.red
  20. enableArea = true
  21. }
  22. // define a window to display the chart in
  23. Window
  24. {
  25. title = "Example Chart"
  26. size = Size(450, 350)
  27. Chart
  28. {
  29. title.text = "Area Chart Example"
  30. xAxis.title.text = "X Series"
  31. yAxis.title.text = "Y Series"
  32. data = [series1, series2]
  33. },
  34. }.open
  35. }
  36. }