A QGraphicsScene subclass which is responsible for the creation, drawing and rendering of a stacked graph.
More...
#include <graphscene.h>
|
void | mousePressEvent (QGraphicsSceneMouseEvent *ev) override |
|
A QGraphicsScene subclass which is responsible for the creation, drawing and rendering of a stacked graph.
Call CreateStackedGraph to create the graph with the currently set attributes. GetBitmap can be used for exporting.
void GraphScene::CreateStackedGraph |
( |
DataSet & |
data | ) |
|
Creates a stacked graph out of the given dataset.
This function puts together the results of the current GraphSorter, GraphLabeler and GraphColorizer to create a visual representation of the data set. Labelling is also optionally performed using a brute-force algorithm.
- Parameters
-
QImage GraphScene::GetBitmap |
( |
int |
width, |
|
|
int |
height, |
|
|
bool |
keepAspect |
|
) |
| |
Renders the current graph into a QImage
.
- Parameters
-
width | The pixel-width of the image |
heigth | The pixel-height of the image |
keepAspect | If true, the aspect ratio of the graph is kept as it is in the application. If false, it uses the ratio of the image. |
- Returns
- a
QImage
of the graph
Sets the coloring attribute to be used by the GraphColorizer when assigning colors to the graph layers.
- Parameters
-
colorAttribute | the attribute used to calculate appropriate colors |
void GraphScene::SetColors |
( |
QColor const |
beginColor, |
|
|
QColor const |
endColor |
|
) |
| |
Sets the colors which define the start and end color of the linearly interpolated color gradient used to define the stacked graphs layer colors.
- Parameters
-
Sets the interpolation method to be used by the GraphLayouter when layouting the graph.
- Parameters
-
interpMode | the interpolation mode |
void GraphScene::SetLabeling |
( |
bool |
enabled | ) |
|
Determines if the layers should show their labels.
The algorithm used for sizing and positioning the labels is based on a simple brute-force method, and may not give the best results in most cases. If no label can fit in a given layer, it gets no label at all.
- Parameters
-
enabled | if true, draw labels |
void GraphScene::SetSorter |
( |
GraphSorter *const |
sorter | ) |
|
Sets the sorting attribute to be used by the GraphSorter when sorting the dataset.
- Parameters
-
sortAttribute | the attribute used to sort the dataset |
The documentation for this class was generated from the following files: