GlistEngine
Loading...
Searching...
No Matches
gGUICandleStickChart Class Reference

#include <gGUICandleStickChart.h>

Inheritance diagram for gGUICandleStickChart:
Collaboration diagram for gGUICandleStickChart:

Public Member Functions

 gGUICandleStickChart ()
virtual ~gGUICandleStickChart ()
void set (gBaseApp *root, gBaseGUIObject *topParentGUIObject, gBaseGUIObject *parentGUIObject, int parentSlotLineNo, int parentSlotColumnNo, int x, int y, int w, int h) override
void setMaxX (float maxX) override
void setMinX (float minX) override
void setMaxY (float maxY) override
void setMinY (float minY) override
void setLabelCountX (int labelCount) override
void setLabelCountY (int labelCount) override
void enableRange (bool isRangeEnabled) override
void setRange (float rangeStart, float rangeEnd) override
void setHighColor (gColor highColor)
gColor getHighColor ()
void setLowColor (gColor lowColor)
gColor getLowColor ()
void addPointToLine (float x, float high, float low, float open, float close)
void setCandleWidth (float candleWidth)
float getCandleWidth ()
void enablePoints (bool arePointsEnabled)
bool isPointsEnabled () const
void setLineColor (int lineIndex, gColor lineColor)
gColor getLineColor (int lineIndex)
void setFilledAreaColor (int lineIndex, gColor fillColor)
gColor getFilledAreaColor (int lineIndex)
void addLine ()
void addData (int lineIndex, std::deque< std::array< float, 2 > > dataToAdd)
void addPointToLine (int lineIndex, float x, float y)
void setPointValues (int lineIndex, int pointIndex, float newX, float newY)
void setPointValues (int lineIndex, float oldX, float oldY, float newX, float newY)
void removeFirstPointsFromLine (int lineIndex, int pointNumLimit)
int getLineNum () const
int getPointNum (int lineIndex)
float getPointXValue (int lineIndex, int pointIndex)
float getPointYValue (int lineIndex, int pointIndex)
void clearLines ()
void clear () override
void setOffset (int leftOffset, int rightOffset, int topOffset, int bottomOffset)
void enableFilledArea (bool isEnabled)
void setLineThickness (float thickness)
float getLineThickness () const
void setRoundedCorners (bool isRounded)
bool getRoundedCorners () const
void enableAutoScale (bool isEnabled)
Public Member Functions inherited from gGUIGraph
 gGUIGraph ()
virtual ~gGUIGraph () override
void set (gBaseApp *root, gBaseGUIObject *topParentGUIObject, gBaseGUIObject *parentGUIObject, int parentSlotLineNo, int parentSlotColumnNo, int x, int y, int w, int h) override
int getMaxX ()
int getMinX ()
int getMaxY ()
int getMinY ()
void enableGridlinesX (bool isEnabled)
void enableGridlinesY (bool isEnabled)
void setAxislinesEnable (bool xaxis, bool yaxis)
void setTitleX (std::string titleX)
std::string getTitleX ()
void setTitleY (std::string titleY)
std::string getTitleY ()
int getLabelCountX ()
int getLabelCountY ()
int getRangeStart ()
int getRangeEnd ()
void enableBackground (bool isEnabled)
bool isBackgroundEnabled ()
void draw () override
Public Member Functions inherited from gGUIControl
 gGUIControl ()
virtual ~gGUIControl () override
int getCursor (int x, int y) override
void update () override
virtual int calculateContentHeight ()
virtual bool countAsSpace ()
void setCountAsSpace (bool isSpace)
void setFont (gFont *font)
gFont * getFont ()
Public Member Functions inherited from gBaseGUIObject
 gBaseGUIObject ()
virtual ~gBaseGUIObject ()
int getId ()
int getType ()
void setEnabled (bool isEnabled)
bool isEnabled ()
void setVisible (bool isVisible)
bool isVisible ()
void setTitleOn (bool isTitleOn)
bool isTitleOn ()
virtual void setTopParent (gBaseGUIObject *parentGUIObject)
gBaseGUIObject * getTopParent ()
virtual void setParent (gBaseGUIObject *parentGUIObject)
gBaseGUIObject * getParent ()
void setParentSlotNo (int parentSlotLineNo, int parentSlotColumnNo)
int getParentSlotLineNo ()
int getParentSlotColumnNo ()
void setTitle (std::string title)
std::string getTitle ()
virtual void keyPressed (int key)
virtual void keyReleased (int key)
virtual void charPressed (unsigned int codepoint)
virtual void mouseMoved (int x, int y)
virtual void mousePressed (int x, int y, int button)
virtual void mouseDragged (int x, int y, int button)
virtual void mouseReleased (int x, int y, int button)
virtual void mouseScrolled (int x, int y)
virtual void mouseEntered ()
virtual void mouseExited ()
virtual void windowResized (int w, int h)
virtual void onGUIEvent (int guiObjectId, int eventType, int sourceEventType, std::string value1="", std::string value2="")
void setRootApp (gBaseApp *root)
virtual void setCursorOn (bool isOn)
virtual void unfocus ()
Public Member Functions inherited from gRenderObject
 gRenderObject ()
int getScreenWidth ()
int getScreenHeight ()
void pushMatrix ()
void popMatrix ()
Public Member Functions inherited from gObject
 gObject ()
void logi (std::string message)
void logd (std::string message)
void logw (std::string message)
void loge (std::string message)
void logi (std::string tag, std::string message)
void logd (std::string tag, std::string message)
void logw (std::string tag, std::string message)
void loge (std::string tag, std::string message)

Protected Member Functions

void drawGraph () override
void drawFilledAreas ()
void drawCandles ()
void drawOverlayLines ()
void updatePoints ()
void updateOffset ()
Protected Member Functions inherited from gGUIGraph
void setLabelsYForRange (float rangeMinY, float rangeMaxY)
void drawPolylineStroke (PolylineStroke &stroke, const gColor &color)

Additional Inherited Members

Public Types inherited from gBaseGUIObject
enum  { TEXTALIGNMENT_LEFT , TEXTALIGNMENT_MIDDLE , TEXTALIGNMENT_RIGHT }
Static Public Member Functions inherited from gBaseGUIObject
static void setBackgroundColor (gColor *backgroundColor)
static gColor * getBackgroundColor ()
static void setMiddlegroundColor (gColor *middlegroundColor)
static gColor * getMiddlegroundColor ()
static void setForegroundColor (gColor *foregroundColor)
static gColor * getForegroundColor ()
static void setTextBackgroundColor (gColor *textBackgroundColor)
static gColor * getTextBackgroundColor ()
static void setNavigationBackgroundColor (gColor *navigationBackgroundColor)
static gColor * getNavigationBackgroundColor ()
static void setFont (gFont *font)
static gFont * getFont ()
static void setFontColor (gColor *fontColor)
static gColor * getFontColor ()
static void setNavigationFontColor (gColor *navigationFontColor)
static gColor * getNavigationFontColor ()
static void setButtonColor (gColor *color)
static gColor * getButtonColor ()
static void setPressedButtonColor (gColor *color)
static gColor * getPressedButtonColor ()
static void setDisabledButtonColor (gColor *color)
static gColor * getDisabledButtonColor ()
static void setButtonFontColor (gColor *color)
static gColor * getButtonFontColor ()
static void setPressedButtonFontColor (gColor *color)
static gColor * getPressedButtonFontColor ()
static void setDisabledButtonFontColor (gColor *color)
static gColor * getDisabledButtonFontColor ()
Static Public Member Functions inherited from gRenderObject
static void setScreenSize (int screenWidth, int screenHeight)
static void setUnitScreenSize (int unitWidth, int unitHeight)
static void setScreenScaling (int screenScaling)
static void enableShadowMapping ()
static void disableShadowMapping ()
static bool isShadowMappingEnabled ()
static void enableExtraShaders (bool isEnabled=true)
static void disableExtraShaders ()
static bool isExtraShadersEnabled ()
static gRenderer * getRenderer ()
static void destroyRenderer ()
static void createRenderer (int renderEngine=G_RENDERER_GL)
Static Public Member Functions inherited from gObject
static std::string gGetAppDir ()
static std::string gGetAssetsDir ()
static void gSetAssetsDir (std::string assetsDir)
static std::string gGetFilesDir ()
static std::string gGetImagesDir ()
static std::string gGetFontsDir ()
static std::string gGetModelsDir ()
static std::string gGetTexturesDir ()
static std::string gGetShadersDir ()
static std::string gGetSoundsDir ()
static std::string gGetDatabasesDir ()
static std::string gGetVideosDir ()
static void setCurrentResolution (int scalingNo, int currentResolutionNo)
Public Attributes inherited from gBaseGUIObject
int id
int type
int left
int top
int right
int bottom
int width
int height
int titlex
int titley
int titleheight
bool isfocused
bool iscursoron
bool issizer
bool iscontainer
bool isresizable
Static Public Attributes inherited from gBaseGUIObject
static const int GUIEVENT_FOCUSED = -1
static const int GUIEVENT_UNFOCUSED = -2
static const int CURSOR_ARROW = 0
static const int CURSOR_IBEAM = 1
static const int CURSOR_CROSSHAIR = 2
static const int CURSOR_HAND = 3
static const int CURSOR_HRESIZE = 4
static const int CURSOR_VRESIZE = 5
static int focusid
static int previousfocusid
Static Public Attributes inherited from gObject
static const int LOGLEVEL_SILENT
static const int LOGLEVEL_DEBUG
static const int LOGLEVEL_INFO
static const int LOGLEVEL_WARNING
static const int LOGLEVEL_ERROR
Static Protected Member Functions inherited from gGUIGraph
static bool buildPolylineRibbon (PolylineMesh &mesh, const std::vector< std::vector< std::array< float, 2 > > > &runs, float halfWidth, bool roundedCorners)
static void buildPolylineStroke (PolylineStroke &stroke, const std::vector< std::vector< std::array< float, 2 > > > &runs, float thickness, bool roundedCorners)
Protected Attributes inherited from gGUIGraph
bool isbackgroundenabled
float axisx1
float axisy1
float axisx2
float axisy2
float axisxstart
float axisystart
float axisxw
float axisyh
float maxy
float miny
float maxx
float minx
float largestvaluex
float largestvaluey
float smallestvaluex
float smallestvaluey
bool gridlinesxenabled
bool gridlinesyenabled
bool isxaxislinenable
bool yaxislenable
bool floatlabelsxenabled
bool floatlabelsyenabled
int labelcountx
int labelcounty
int rangestart
int rangeend
bool rangeenabled
Protected Attributes inherited from gGUIControl
bool countasspace
int oldwidth
int oldheight
gFont * localfont
Protected Attributes inherited from gBaseGUIObject
std::string title
gBaseApp * root
gBaseGUIObject * topparent
gBaseGUIObject * parent
bool isenabled
bool isvisible
bool istitleon
int parentslotlineno
int parentslotcolumnno
Static Protected Attributes inherited from gBaseGUIObject
static gColor * backgroundcolor
static gColor * middlegroundcolor
static gColor * foregroundcolor
static gColor * textbackgroundcolor
static gColor * navigationbackgroundcolor
static gFont * font
static gColor * fontcolor
static gColor * navigationfontcolor
static gColor * buttoncolor
static gColor * pressedbuttoncolor
static gColor * disabledbuttoncolor
static gColor * buttonfontcolor
static gColor * pressedbuttonfontcolor
static gColor * disabledbuttonfontcolor
static gGUIActionManager actionmanager
static gGUIResources res
Static Protected Attributes inherited from gRenderObject
static bool isshadowmappingenabled
static bool isextrashadersenabled
Static Protected Attributes inherited from gObject
static int renderpassnum
static int renderpassno
static int releasescaling
static int releaseresolution

Constructor & Destructor Documentation

◆ gGUICandleStickChart()

gGUICandleStickChart::gGUICandleStickChart ( )

◆ ~gGUICandleStickChart()

virtual gGUICandleStickChart::~gGUICandleStickChart ( )
virtual

Member Function Documentation

◆ addData()

void gGUICandleStickChart::addData ( int lineIndex,
std::deque< std::array< float, 2 > > dataToAdd )

Appends a batch of (x, y) points to a specific overlay line series.

◆ addLine()

void gGUICandleStickChart::addLine ( )

Adds a new overlay line series data container to the chart.

◆ addPointToLine() [1/2]

void gGUICandleStickChart::addPointToLine ( float x,
float high,
float low,
float open,
float close )

Appends a candlestick data point (x, high, low, open, close) to the chart.

◆ addPointToLine() [2/2]

void gGUICandleStickChart::addPointToLine ( int lineIndex,
float x,
float y )

Appends a single (x, y) data point to a specific overlay line series.

◆ clear()

void gGUICandleStickChart::clear ( )
overridevirtual

Clears all candlesticks, overlay line series, and cached geometry from the chart.

Reimplemented from gGUIGraph.

◆ clearLines()

void gGUICandleStickChart::clearLines ( )

Clears only the overlay line series and their cached geometry while keeping candlesticks intact.

◆ drawCandles()

void gGUICandleStickChart::drawCandles ( )
protected

◆ drawFilledAreas()

void gGUICandleStickChart::drawFilledAreas ( )
protected

◆ drawGraph()

void gGUICandleStickChart::drawGraph ( )
overrideprotectedvirtual

Reimplemented from gGUIGraph.

◆ drawOverlayLines()

void gGUICandleStickChart::drawOverlayLines ( )
protected

◆ enableAutoScale()

void gGUICandleStickChart::enableAutoScale ( bool isEnabled)

Enables or disables auto-scaling of the Y axis tightly to the actual min/max data range across both candlesticks and overlay lines.

◆ enableFilledArea()

void gGUICandleStickChart::enableFilledArea ( bool isEnabled)

Enables or disables drawing a filled area beneath overlay lines.

◆ enablePoints()

void gGUICandleStickChart::enablePoints ( bool arePointsEnabled)

Enables or disables drawing circles/points at overlay line data coordinates. Defaults to false on candlestick charts to keep candle bodies unobstructed.

◆ enableRange()

void gGUICandleStickChart::enableRange ( bool isRangeEnabled)
overridevirtual

Enables or disables drawing only data within the configured X range.

Reimplemented from gGUIGraph.

◆ getCandleWidth()

float gGUICandleStickChart::getCandleWidth ( )

◆ getFilledAreaColor()

gColor gGUICandleStickChart::getFilledAreaColor ( int lineIndex)

Gets the filled area color under a specific overlay line index.

◆ getHighColor()

gColor gGUICandleStickChart::getHighColor ( )

◆ getLineColor()

gColor gGUICandleStickChart::getLineColor ( int lineIndex)

Gets the drawing color of a specific overlay line index.

◆ getLineNum()

int gGUICandleStickChart::getLineNum ( ) const

Gets the total number of overlay line series in the chart.

◆ getLineThickness()

float gGUICandleStickChart::getLineThickness ( ) const

Gets the configured thickness of overlay line segments.

◆ getLowColor()

gColor gGUICandleStickChart::getLowColor ( )

◆ getPointNum()

int gGUICandleStickChart::getPointNum ( int lineIndex)

Gets the total number of points in a specific overlay line series.

◆ getPointXValue()

float gGUICandleStickChart::getPointXValue ( int lineIndex,
int pointIndex )

Gets the raw X value of a point inside a specific overlay line series.

◆ getPointYValue()

float gGUICandleStickChart::getPointYValue ( int lineIndex,
int pointIndex )

Gets the raw Y value of a point inside a specific overlay line series.

◆ getRoundedCorners()

bool gGUICandleStickChart::getRoundedCorners ( ) const

Returns whether rounded corners and edge smoothing are enabled on overlay lines.

◆ isPointsEnabled()

bool gGUICandleStickChart::isPointsEnabled ( ) const

Returns whether overlay line point markers are enabled.

◆ removeFirstPointsFromLine()

void gGUICandleStickChart::removeFirstPointsFromLine ( int lineIndex,
int pointNumLimit )

Truncates the oldest points from the beginning of an overlay line series if its size meets or exceeds pointNumLimit.

◆ set()

void gGUICandleStickChart::set ( gBaseApp * root,
gBaseGUIObject * topParentGUIObject,
gBaseGUIObject * parentGUIObject,
int parentSlotLineNo,
int parentSlotColumnNo,
int x,
int y,
int w,
int h )
overridevirtual

Sets the positioning, slot indexing, and dimensions of the candlestick chart control.

Reimplemented from gGUIControl.

◆ setCandleWidth()

void gGUICandleStickChart::setCandleWidth ( float candleWidth)

◆ setFilledAreaColor()

void gGUICandleStickChart::setFilledAreaColor ( int lineIndex,
gColor fillColor )

Sets the filled area color under a specific overlay line index.

◆ setHighColor()

void gGUICandleStickChart::setHighColor ( gColor highColor)

◆ setLabelCountX()

void gGUICandleStickChart::setLabelCountX ( int labelCount)
overridevirtual

Sets the number of labels to be drawn on the X axis.

Reimplemented from gGUIGraph.

◆ setLabelCountY()

void gGUICandleStickChart::setLabelCountY ( int labelCount)
overridevirtual

Sets the number of labels to be drawn on the Y axis.

Reimplemented from gGUIGraph.

◆ setLineColor()

void gGUICandleStickChart::setLineColor ( int lineIndex,
gColor lineColor )

Sets the drawing color for a specific overlay line index.

◆ setLineThickness()

void gGUICandleStickChart::setLineThickness ( float thickness)

Configures the thickness of overlay line segments.

◆ setLowColor()

void gGUICandleStickChart::setLowColor ( gColor lowColor)

◆ setMaxX()

void gGUICandleStickChart::setMaxX ( float maxX)
overridevirtual

Sets the maximum value limit of the X axis.

Reimplemented from gGUIGraph.

◆ setMaxY()

void gGUICandleStickChart::setMaxY ( float maxY)
overridevirtual

Sets the maximum value limit of the Y axis.

Reimplemented from gGUIGraph.

◆ setMinX()

void gGUICandleStickChart::setMinX ( float minX)
overridevirtual

Sets the minimum value limit of the X axis.

Reimplemented from gGUIGraph.

◆ setMinY()

void gGUICandleStickChart::setMinY ( float minY)
overridevirtual

Sets the minimum value limit of the Y axis.

Reimplemented from gGUIGraph.

◆ setOffset()

void gGUICandleStickChart::setOffset ( int leftOffset,
int rightOffset,
int topOffset,
int bottomOffset )

Configures outer margins/padding around the chart axes boundary.

◆ setPointValues() [1/2]

void gGUICandleStickChart::setPointValues ( int lineIndex,
float oldX,
float oldY,
float newX,
float newY )

Finds a data point by old coordinates in an overlay line series and updates it to new coordinates.

◆ setPointValues() [2/2]

void gGUICandleStickChart::setPointValues ( int lineIndex,
int pointIndex,
float newX,
float newY )

Updates the coordinates of a data point at a specific 0-based index in an overlay line series.

◆ setRange()

void gGUICandleStickChart::setRange ( float rangeStart,
float rangeEnd )
overridevirtual

Configures the visible X range when range filtering is enabled.

Reimplemented from gGUIGraph.

◆ setRoundedCorners()

void gGUICandleStickChart::setRoundedCorners ( bool isRounded)

Enables or disables rounded corners and edge smoothing on overlay lines. Disabled (false) by default for sharp, unsmoothed corners.

◆ updateOffset()

void gGUICandleStickChart::updateOffset ( )
protected

◆ updatePoints()

void gGUICandleStickChart::updatePoints ( )
protected

The documentation for this class was generated from the following file: