example-13.fan 966 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using fwt
  2. using gfx
  3. using swtChartWrapper
  4. class Example13
  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. yErrorBar.with
  14. {
  15. color = Color.red
  16. minusErrors = [0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f]
  17. plusErrors = [0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f]
  18. visible = true
  19. }
  20. }
  21. // define a window to display the chart in
  22. Window
  23. {
  24. title = "Example Chart"
  25. size = Size(450, 350)
  26. Chart
  27. {
  28. title.text = "Error Bars Example"
  29. xAxis.title.text = "Data Points"
  30. yAxis.title.text = "Amplitude"
  31. data = [series]
  32. },
  33. }.open
  34. }
  35. }