Show More
examples-scatterchart.qdoc
27 lines
| 941 B
| text/plain
|
TextLexer
Michal Klocek
|
r471 | /*! | ||
Tero Ahola
|
r500 | \example examples/scatterchart | ||
Michal Klocek
|
r471 | \title ScatterChart Example | ||
\subtitle | ||||
Nico Vertriest
|
r2610 | The example shows how to create a simple scatter chart. | ||
Michal Klocek
|
r471 | |||
Tero Ahola
|
r979 | \image examples_scatterchart.png | ||
Nico Vertriest
|
r2610 | |||
To create scatter charts, a QScatterSeries instance is needed. Here we create a scatter series instance, and set the type, color, and width of outline for the scatter points. | ||||
Michal Klocek
|
r471 | |||
Tero Ahola
|
r1015 | \snippet ../examples/scatterchart/chartview.cpp 1 | ||
Michal Klocek
|
r471 | |||
Nico Vertriest
|
r2610 | We add the data to be shown. We can use the append() member function or use the stream operator. | ||
Michal Klocek
|
r471 | |||
Tero Ahola
|
r1015 | \snippet ../examples/scatterchart/chartview.cpp 2 | ||
Michal Klocek
|
r471 | |||
Nico Vertriest
|
r2610 | In the end we enable anti-aliasing, set the chart title, and add the scatter series onto the chart. We also disable | ||
Tero Ahola
|
r1015 | drop shadow, because it would not look good on an application with only chart view shown. | ||
Michal Klocek
|
r471 | |||
Tero Ahola
|
r1015 | \snippet ../examples/scatterchart/chartview.cpp 3 | ||
Nico Vertriest
|
r2610 | |||
The chart is ready to be shown. | ||||
Tero Ahola
|
r1015 | \snippet ../examples/scatterchart/main.cpp 4 | ||
Nico Vertriest
|
r2610 | |||
Tero Ahola
|
r979 | */ | ||