123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using fwt
- using gfx
- using swtChartWrapper
- class Example12
- {
- private static Float[] createSeries ()
- {
- size := 1048576 // Fantom runs very slow with such a large value
- series := List.make(Float#, size)
- for (Int i := 0; i < size; i++)
- {
- series.add (((Float.pi * 33.0f * i).sin / size) + ((Float.pi * 15.0f * i).sin / size))
- }
- return series
- }
- public static Void main ()
- {
- // define the series of data points to display
- series := LineSeries
- {
- label = "line series"
- points = createSeries ()
- symbolType = PlotSymbolType.none
- }
- // define a window to display the chart in
- Window
- {
- title = "Example Chart"
- size = Size(450, 350)
- Chart
- {
- title.text = "Large Dataset Example"
- xAxis.title.text = "Data Points"
- yAxis.title.text = "Amplitude"
- data = [series]
- },
- }.open
- }
- }
|