Forge
Chart Class Reference

Chart is base canvas where other plottable objects are rendered. More...

#include <chart.h>

Public Member Functions

FGAPI Chart (const ChartType cType)
 Creates a Chart object with given dimensional property. More...
 
FGAPI Chart (const Chart &pOther)
 Chart copy constructor. More...
 
FGAPI ~Chart ()
 Chart destructor. More...
 
FGAPI void setAxesTitles (const char *pX, const char *pY, const char *pZ=NULL)
 Set axes titles for the chart. More...
 
FGAPI void setAxesLimits (const float pXmin, const float pXmax, const float pYmin, const float pYmax, const float pZmin=0, const float pZmax=0)
 Set axes data ranges. More...
 
FGAPI void setAxesLabelFormat (const char *pXFormat, const char *pYFormat="%4.1f", const char *pZFormat="%4.1f")
 Set the format for display of axes labels. More...
 
FGAPI void getAxesLimits (float *pXmin, float *pXmax, float *pYmin, float *pYmax, float *pZmin=NULL, float *pZmax=NULL)
 Get axes data ranges. More...
 
FGAPI void setLegendPosition (const float pX, const float pY)
 Set legend position for Chart. More...
 
FGAPI void add (const Image &pImage)
 Add an existing Image object to the current chart. More...
 
FGAPI void add (const Histogram &pHistogram)
 Add an existing Histogram object to the current chart. More...
 
FGAPI void add (const Plot &pPlot)
 Add an existing Plot object to the current chart. More...
 
FGAPI void add (const Surface &pSurface)
 Add an existing Surface object to the current chart. More...
 
FGAPI void add (const VectorField &pVectorField)
 Add an existing vector field object to the current chart. More...
 
FGAPI Image image (const unsigned pWidth, const unsigned pHeight, const ChannelFormat pFormat=FG_RGBA, const dtype pDataType=f32)
 Create and add an Image object to the current chart. More...
 
FGAPI Histogram histogram (const unsigned pNBins, const dtype pDataType)
 Create and add an Histogram object to the current chart. More...
 
FGAPI Plot plot (const unsigned pNumPoints, const dtype pDataType, const PlotType pPlotType=FG_PLOT_LINE, const MarkerType pMarkerType=FG_MARKER_NONE)
 Create and add an Plot object to the current chart. More...
 
FGAPI Surface surface (const unsigned pNumXPoints, const unsigned pNumYPoints, const dtype pDataType, const PlotType pPlotType=FG_PLOT_SURFACE, const MarkerType pMarkerType=FG_MARKER_NONE)
 Create and add an Plot object to the current chart. More...
 
FGAPI VectorField vectorField (const unsigned pNumPoints, const dtype pDataType)
 Create and add an Vector Field object to the current chart. More...
 
FGAPI void render (const Window &pWindow, const int pX, const int pY, const int pVPW, const int pVPH) const
 Render the chart to given window. More...
 
FGAPI fg_chart get () const
 Get the handle to internal implementation of Chart. More...
 
FGAPI ChartType getChartType () const
 Get the type of the chart. More...
 

Detailed Description

Chart is base canvas where other plottable objects are rendered.

Charts come in two types:

Examples
cpu/bubblechart.cpp, cpu/field.cpp, cpu/histogram.cpp, cpu/plot3.cpp, cpu/plotting.cpp, cpu/stream.cpp, cpu/surface.cpp, opencl/bubblechart.cpp, opencl/field.cpp, opencl/histogram.cpp, opencl/plot3.cpp, opencl/plotting.cpp, opencl/stream.cpp, and opencl/surface.cpp.

Constructor & Destructor Documentation

◆ Chart() [1/2]

FGAPI Chart ( const ChartType  cType)

Creates a Chart object with given dimensional property.

Parameters
[in]cTypeis chart dimension property

◆ Chart() [2/2]

FGAPI Chart ( const Chart pOther)

Chart copy constructor.

◆ ~Chart()

FGAPI ~Chart ( )

Chart destructor.

Member Function Documentation

◆ add() [1/5]

FGAPI void add ( const Histogram pHistogram)

Add an existing Histogram object to the current chart.

Parameters
[in]pHistogramis the Histogram to render on the chart

◆ add() [2/5]

FGAPI void add ( const Image pImage)

Add an existing Image object to the current chart.

Parameters
[in]pImageis the Image to render on the chart

◆ add() [3/5]

FGAPI void add ( const Plot pPlot)

Add an existing Plot object to the current chart.

Parameters
[in]pPlotis the Plot to render on the chart

◆ add() [4/5]

FGAPI void add ( const Surface pSurface)

Add an existing Surface object to the current chart.

Parameters
[in]pSurfaceis the Surface to render on the chart

◆ add() [5/5]

FGAPI void add ( const VectorField pVectorField)

Add an existing vector field object to the current chart.

Parameters
[in]pVectorFieldis the Surface to render on the chart

◆ get()

FGAPI fg_chart get ( ) const

Get the handle to internal implementation of Chart.

◆ getAxesLimits()

FGAPI void getAxesLimits ( float *  pXmin,
float *  pXmax,
float *  pYmin,
float *  pYmax,
float *  pZmin = NULL,
float *  pZmax = NULL 
)

Get axes data ranges.

Parameters
[out]pXminis x-axis minimum data value
[out]pXmaxis x-axis maximum data value
[out]pYminis y-axis minimum data value
[out]pYmaxis y-axis maximum data value
[out]pZminis z-axis minimum data value
[out]pZmaxis z-axis maximum data value

◆ getChartType()

FGAPI ChartType getChartType ( ) const

Get the type of the chart.

◆ histogram()

FGAPI Histogram histogram ( const unsigned  pNBins,
const dtype  pDataType 
)

Create and add an Histogram object to the current chart.

Parameters
[in]pNBinsis number of bins the data is sorted out
[in]pDataTypetakes one of the values of dtype that indicates the integral data type of histogram data

◆ image()

FGAPI Image image ( const unsigned  pWidth,
const unsigned  pHeight,
const ChannelFormat  pFormat = FG_RGBA,
const dtype  pDataType = f32 
)

Create and add an Image object to the current chart.

Parameters
[in]pWidthWidth of the image
[in]pHeightHeight of the image
[in]pFormatColor channel format of image, uses one of the values of ChannelFormat
[in]pDataTypetakes one of the values of dtype that indicates the integral data type of histogram data

◆ plot()

FGAPI Plot plot ( const unsigned  pNumPoints,
const dtype  pDataType,
const PlotType  pPlotType = FG_PLOT_LINE,
const MarkerType  pMarkerType = FG_MARKER_NONE 
)

Create and add an Plot object to the current chart.

Parameters
[in]pNumPointsis number of data points to display
[in]pDataTypetakes one of the values of dtype that indicates the integral data type of plot data
[in]pPlotTypedictates the type of plot/graph, it can take one of the values of PlotType
[in]pMarkerTypeindicates which symbol is rendered as marker. It can take one of the values of MarkerType.

◆ render()

FGAPI void render ( const Window pWindow,
const int  pX,
const int  pY,
const int  pVPW,
const int  pVPH 
) const

Render the chart to given window.

Parameters
[in]pWindowis target window to where chart will be rendered
[in]pXis x coordinate of origin of viewport in window coordinates
[in]pYis y coordinate of origin of viewport in window coordinates
[in]pVPWis the width of the viewport
[in]pVPHis the height of the viewport

◆ setAxesLabelFormat()

FGAPI void setAxesLabelFormat ( const char *  pXFormat,
const char *  pYFormat = "%4.1f",
const char *  pZFormat = "%4.1f" 
)

Set the format for display of axes labels.

Parameters
[in]pXFormatsets the display format for numbers of X axis
[in]pYFormatsets the display format for numbers of Y axis
[in]pZFormatsets the display format for numbers of Z axis

Display format string follows printf style formating for numbers

◆ setAxesLimits()

FGAPI void setAxesLimits ( const float  pXmin,
const float  pXmax,
const float  pYmin,
const float  pYmax,
const float  pZmin = 0,
const float  pZmax = 0 
)

Set axes data ranges.

Parameters
[in]pXminis x-axis minimum data value
[in]pXmaxis x-axis maximum data value
[in]pYminis y-axis minimum data value
[in]pYmaxis y-axis maximum data value
[in]pZminis z-axis minimum data value
[in]pZmaxis z-axis maximum data value

◆ setAxesTitles()

FGAPI void setAxesTitles ( const char *  pX,
const char *  pY,
const char *  pZ = NULL 
)

Set axes titles for the chart.

Parameters
[in]pXis x-axis title label
[in]pYis y-axis title label
[in]pZis z-axis title label

◆ setLegendPosition()

FGAPI void setLegendPosition ( const float  pX,
const float  pY 
)

Set legend position for Chart.

Parameters
[in]pXis horizontal position in normalized coordinates
[in]pYis vertical position in normalized coordinates
Note
By normalized coordinates, the range of these coordinates is expected to be [0-1]. (0,0) is the bottom hand left corner.

◆ surface()

FGAPI Surface surface ( const unsigned  pNumXPoints,
const unsigned  pNumYPoints,
const dtype  pDataType,
const PlotType  pPlotType = FG_PLOT_SURFACE,
const MarkerType  pMarkerType = FG_MARKER_NONE 
)

Create and add an Plot object to the current chart.

Parameters
[in]pNumXPointsis number of data points along X dimension
[in]pNumYPointsis number of data points along Y dimension
[in]pDataTypetakes one of the values of dtype that indicates the integral data type of plot data
[in]pPlotTypeis the render type which can be one of PlotType (valid choices are FG_PLOT_SURFACE and FG_PLOT_SCATTER)
[in]pMarkerTypeis the type of MarkerType to draw for FG_PLOT_SCATTER plot type

◆ vectorField()

FGAPI VectorField vectorField ( const unsigned  pNumPoints,
const dtype  pDataType 
)

Create and add an Vector Field object to the current chart.

Parameters
[in]pNumPointsis number of data points to display
[in]pDataTypetakes one of the values of dtype that indicates the integral data type of vector field data

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