example-6.fan 854 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using fwt
  2. using gfx
  3. using swtChartWrapper
  4. class Example6
  5. {
  6. public static Void main ()
  7. {
  8. // define two 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. enableStack = true
  14. }
  15. series2 := BarSeries
  16. {
  17. label = "bar series 2"
  18. points = [4.0f, 2.2f, 3.4f, 1.7f, 0.9f]
  19. color = Color.green
  20. enableStack = true
  21. }
  22. // define a window to display the chart in
  23. Window
  24. {
  25. title = "Example Chart"
  26. size = Size(450, 350)
  27. // create the chart
  28. Chart
  29. {
  30. title.text = "Stacked Chart Example"
  31. xAxis.title.text = "Month"
  32. xAxis.categories = ["Mar", "Apr", "May", "Jun", "Jul"]
  33. yAxis.title.text = "Amplitude"
  34. data = [series1, series2]
  35. },
  36. }.open
  37. }
  38. }