PieChart is only used within TouchGFX.
 
Symbols
loading...
Files
loading...

PieChart class

@class PieChart PieChart.hpp C:\Projects\playground\app\demo\touchgfx_demo2015\gui\include\gui\graph_screen\PieChart.hpp A pie chart. The PieChart class supports drawing a circular pie chart. It supports a start/end angle and inner/outer radius allowing everything from a semi donut to a full circle to be drawn. A pie chart can also be animated from one look to another look. @see Container

Syntax

class PieChart : public Container { public:     PieChart();     void setSlices(int newShares[NUM_ITEMS]); #if !defined(USE_BPP) || USE_BPP==16     void setPainter(int index, AbstractPainterRGB565& painter); #elif USE_BPP==24     void setPainter(int index, AbstractPainterRGB888& painter); #elif USE_BPP==4     void setPainter(int index, AbstractPainterGRAY4& painter); #elif USE_BPP==2     void setPainter(int index, AbstractPainterGRAY2& painter); #else #error Unknown USE_BPP #endif     void setRadiuses(int innerRadius, int outerRadius);     void setAngles(int newMinAngle, int newMaxAngle);     void setPieChart(int newStartAngle, int newEndAngle, int newMinRadius, int newMaxRadius);     void startPieChartAnimation(int toStartAngle, int toEndAngle, int toMinRadius, int toMaxRadius, int steps, EasingEquation newAngleEquation = &EasingEquations::linearEaseNone, EasingEquation newRadiusEquation = &EasingEquations::linearEaseNone);     void getAngles(int& currentMinAngle, int& currentMaxAngle) const;     void setCenter(int newCenterX, int newCenterY);     void setSelectAnimationSteps(int steps);     void recalculatePieChart();     void animateSelected(int steps, EasingEquation progressionEquation = &EasingEquations::linearEaseNone);     void setSelected(int slice, bool value);     bool isSelected(int slice) const;     void unselectAll();     void setPieChartSelectionCallback(GenericCallback<const PieChart&, int>& callback);     void setPieChartAnimationEndedCallback(GenericCallback<const PieChart&>& callback);     void activatePieChartAnimationEndedCallback(bool active);     virtual void setWidth(int16_t width);     virtual void setHeight(int16_t height);     virtual void handleClickEvent(const ClickEvent& evt);     virtual void handleTickEvent(); private:     int slice[NUM_ITEMS];                          int sliceSum;                                  Circle circle[NUM_ITEMS];                      int displacement[NUM_ITEMS];                   int minRadius, maxRadius;                      int minAngle, maxAngle;                        int centerX, centerY;                          bool animationRunning;         int expand[NUM_ITEMS];         bool selected[NUM_ITEMS];      int selectAnimationSteps;     enum     {         CHANGE_PIECHART,          SELECT_DESELECT       };     int animationType;                                           int startAngleInit, startAngleExit;                          int endAngleInit, endAngleExit;                              int minRadiusInit, minRadiusExit;                            int maxRadiusInit, maxRadiusExit;                            int currentStep;                                             int animationSteps;                                          EasingEquation angleEquation;                                EasingEquation radiusEquation;                               GenericCallback<const PieChart&, int>* selectionAction;      GenericCallback<const PieChart&>* animationEndedAction;      bool animationEndedCallbackActive;                       };

Fields

slice

No summary provided. Read more...

sliceSum

No summary provided. Read more...

circle

No summary provided. Read more...

displacement

No summary provided. Read more...

minRadius

No summary provided. Read more...

maxRadius

No summary provided. Read more...

minAngle

No summary provided. Read more...

maxAngle

No summary provided. Read more...

centerX

No summary provided. Read more...

centerY

No summary provided. Read more...

animationRunning

No summary provided. Read more...

expand

No summary provided. Read more...

selected

No summary provided. Read more...

selectAnimationSteps

No summary provided. Read more...

animationType

No summary provided. Read more...

startAngleInit

No summary provided. Read more...

startAngleExit

No summary provided. Read more...

endAngleInit

No summary provided. Read more...

endAngleExit

No summary provided. Read more...

minRadiusInit

No summary provided. Read more...

minRadiusExit

No summary provided. Read more...

maxRadiusInit

No summary provided. Read more...

maxRadiusExit

No summary provided. Read more...

currentStep

No summary provided. Read more...

animationSteps

No summary provided. Read more...

angleEquation

No summary provided. Read more...

radiusEquation

No summary provided. Read more...

selectionAction

No summary provided. Read more...

animationEndedAction

No summary provided. Read more...

animationEndedCallbackActive

No summary provided. Read more...

Methods

setRadiuses()

@fn void PieChart::setRadiuses(int innerRadius, int outerRadius); Sets the radiuses. Sets the radiuses. If the inner radius is zero a full circle is drawn. @see startAnimation @see setPieChart. Read more...

setAngles()

@fn void PieChart::setAngles(int newMinAngle, int newMaxAngle); Sets the angles of the pie chart. Sets the angles of the pie chart. Example values could be (-90,90) which will draw a semi donut with a flat bottom, (0,360) will draw a full circle with the first slice starting from the top going clockwise. @see getAngels @see setPieChart. Read more...

setPieChart()

@fn void PieChart::setPieChart(int newStartAngle, int newEndAngle, int newMinRadius, int newMaxRadius); Sets pie chart. Sets pie chart with the given angles and radiuses by calling setAngles and setRadiuses. Also sets the current shape of the PieChart. @see setAngles @see setRadiuses. Read more...

startPieChartAnimation()

@fn void PieChart::startPieChartAnimation(int toStartAngle, int toEndAngle, int toMinRadius, int toMaxRadius, int steps, EasingEquation newAngleEquation = &EasingEquations::linearEaseNone, EasingEquation newRadiusEquation = &EasingEquations::linearEaseNone); Starts an animation. Starts an animation. The parameters given specifies what the pie chart should be animated into. Read more...

getAngles() const

@fn void PieChart::getAngles(int &currentMinAngle, int &currentMaxAngle) const; Gets the angles. Gets the angles previously set with setAngles. @see setAngles. Read more...

setCenter()

@fn void PieChart::setCenter(int newCenterX, int newCenterY); Sets a center of the pie chart. Sets a center of the pie chart relative to the top left corner of the widget. Read more...

setSelectAnimationSteps()

@fn void PieChart::setSelectAnimationSteps(int steps); Sets select animation steps. Sets select animation steps. This is the number of steps to animate the slice that is selected when it is moved towards or away from the center of the pie. Read more...

recalculatePieChart()

@fn void PieChart::recalculatePieChart(); Calculates the chart. Calculates the chart after changes of slice sizes, displacements of selected slices, etc. Read more...

animateSelected()

@fn void PieChart::animateSelected(int steps, EasingEquation progressionEquation = &EasingEquations::linearEaseNone); Start animation of the selected slice(s). Start animation of the selected slice(s). @see setSelected. Read more...

setSelected()

@fn void PieChart::setSelected(int slice, bool value); Selects or de-selects a slice. Selects or de-selects a slice. The slice will automatically be animated. If a selection callback has been set, it is also called. @see animateSelected @see setPieChartSelectionCallback. Read more...

isSelected() const

@fn bool PieChart::isSelected(int slice) const; Query if 'slice' is selected. @see setSelected. Read more...

unselectAll()

@fn void PieChart::unselectAll(); Unselect all slices and halt animation. Unselect all slices and halt animation. Read more...

setPieChartSelectionCallback()

@fn void PieChart::setPieChartSelectionCallback(GenericCallback& callback) Associates an action to be performed when slice is selected or de-selected. Associates an action to be performed when slice is selected or de-selected. @see GenericCallback. Read more...

setPieChartAnimationEndedCallback()

@fn void PieChart::setPieChartAnimationEndedCallback(GenericCallback& callback) Associates an action to be performed when an animation finishes. Associates an action to be performed when an animation finishes. @see GenericCallback. Read more...

activatePieChartAnimationEndedCallback()

@fn void PieChart::activatePieChartAnimationEndedCallback(bool active); Activates or deactivates the callback when an animation ends. Read more...

setWidth()

@fn virtual void PieChart::setWidth(int16_t width); Sets width of the widget. Sets width of the widget and all pie chart slices in the PieChart. Inherited from Container. Read more...

setHeight()

@fn virtual void PieChart::setHeight(int16_t height); Sets height of the widget. Sets height of the widget and all pie chart slices in the PieChart. Inherited from Container. Read more...

handleClickEvent()

@fn virtual void PieChart::handleClickEvent(const ClickEvent& evt); Handles the click event described by evt. Handles the click event described by evt. Clicking a slice will (de)select it, clicking the center of the pie chart will (de)select all slices. Read more...

handleTickEvent()

@fn virtual void PieChart::handleTickEvent(); Handles the tick event. Handles the tick event. This takes care of animation. Read more...

setSlices()

@fn void PieChart::setSlices(int newShares[NUM_ITEMS]); Sets the sizes of the slices. Set the sizes of the slices that make up the pie chart. Each value in the array should be >0. Each slice is sized relative to the other values in the pie chart. Read more...

setPainter()

@fn void PieChart::setPainter(int index, AbstractPainterRGB565& painter); Sets the painter for a given slice. Sets the painter for a given slices. Read more...

References

LocationReferrerScopeText
PieChart.hpp:56
class PieChart : public Container
GraphView.cpp:620GraphView::legendSelectedHandler()
void GraphView::legendSelectedHandler(const PieChart& thePieChart, int item)
GraphView.cpp:628GraphView::pieChartAnimationEndedHandler()
GraphView.hpp:116
GraphView.hpp:142GraphView::legendSelectedHandler()::thePieChartGraphView::legendSelectedHandler()
void legendSelectedHandler(const PieChart& thePieChart, int item);
GraphView.hpp:145GraphView::pieChartAnimationEndedHandler()::thePieChartGraphView::pieChartAnimationEndedHandler()
PieChart.cpp:21PieChart::PieChart()
PieChart::PieChart():
PieChart.cpp:50PieChart::setSlices()
void PieChart::setSlices(int newShares[NUM_ITEMS])
PieChart.cpp:61PieChart::setPainter()
PieChart.cpp:78PieChart::setRadiuses()
void PieChart::setRadiuses(int innerRadius, int outerRadius)
PieChart.cpp:85PieChart::setAngles()
void PieChart::setAngles(int newMinAngle, int newMaxAngle)
PieChart.cpp:92PieChart::getAngles() const
void PieChart::getAngles(int& currentMinAngle, int& currentMaxAngle) const
PieChart.cpp:98PieChart::setPieChart()
PieChart.cpp:109PieChart::setCenter()
void PieChart::setCenter(int newCenterX, int newCenterY)
PieChart.cpp:116PieChart::setSelectAnimationSteps()
void PieChart::setSelectAnimationSteps(int steps)
PieChart.cpp:124PieChart::setSelected()
void PieChart::setSelected(int index, bool value)
PieChart.cpp:144PieChart::isSelected() const
bool PieChart::isSelected(int share) const
PieChart.cpp:149PieChart::unselectAll()
void PieChart::unselectAll()
PieChart.cpp:164PieChart::recalculatePieChart()
void PieChart::recalculatePieChart()
PieChart.cpp:203PieChart::startPieChartAnimation()
void PieChart::startPieChartAnimation(int toStartAngle, int toEndAngle, int toMinRadius, int toMaxRadius, int steps, EasingEquation newAngleEquation /*= &EasingEquations::linearEaseNone*/, EasingEquation newRadiusEquation /*= &EasingEquations::linearEaseNone*/)
PieChart.cpp:226PieChart::animateSelected()
PieChart.cpp:236PieChart::setPieChartSelectionCallback()
void PieChart::setPieChartSelectionCallback(GenericCallback<const PieChart&, int>& callback)
PieChart.cpp:241PieChart::setPieChartAnimationEndedCallback()
void PieChart::setPieChartAnimationEndedCallback(GenericCallback<const PieChart&>& callback)
PieChart.cpp:247PieChart::activatePieChartAnimationEndedCallback()
PieChart.cpp:252PieChart::setWidth()
void PieChart::setWidth(int16_t width)
PieChart.cpp:261PieChart::setHeight()
void PieChart::setHeight(int16_t height)
PieChart.cpp:270PieChart::handleClickEvent()
void PieChart::handleClickEvent(const ClickEvent& evt)
PieChart.cpp:362PieChart::handleTickEvent()
void PieChart::handleTickEvent()

Class Tree

Child classes
PieChart
all items filtered out