Forge
Chart_functions

Functions

FGAPI fg_err fg_create_chart (fg_chart *pHandle, const fg_chart_type pChartType)
 Create a Chart object with given dimensional property.
FGAPI fg_err fg_retain_chart (fg_chart *pOut, fg_chart pChart)
 Increase reference count for the chart resource.
FGAPI fg_err fg_release_chart (fg_chart pHandle)
 Destroy the chart object.
FGAPI fg_err fg_set_chart_axes_titles (fg_chart pHandle, const char *pX, const char *pY, const char *pZ)
 Set axes titles for the chart.
FGAPI fg_err fg_set_chart_axes_limits (fg_chart pHandle, const float pXmin, const float pXmax, const float pYmin, const float pYmax, const float pZmin, const float pZmax)
 Set axes data ranges.
FGAPI fg_err fg_set_chart_label_format (fg_chart pHandle, const char *pXFormat, const char *pYFormat, const char *pZFormat)
 Set the format for display of axes labels in a chart.
FGAPI fg_err fg_get_chart_axes_limits (float *pXmin, float *pXmax, float *pYmin, float *pYmax, float *pZmin, float *pZmax, const fg_chart pHandle)
 Get axes data ranges.
FGAPI fg_err fg_set_chart_legend_position (fg_chart pHandle, const float pX, const float pY)
 Set legend position for Chart.
FGAPI fg_err fg_append_image_to_chart (fg_chart pChart, fg_image pImage)
 Add an existing image object to chart.
FGAPI fg_err fg_append_histogram_to_chart (fg_chart pChart, fg_histogram pHistogram)
 Add an existing histogram object to chart.
FGAPI fg_err fg_append_plot_to_chart (fg_chart pChart, fg_plot pPlot)
 Add an existing plot object to chart.
FGAPI fg_err fg_append_surface_to_chart (fg_chart pChart, fg_surface pSurface)
 Add an existing surface object to chart.
FGAPI fg_err fg_append_vector_field_to_chart (fg_chart pChart, fg_vector_field pField)
 Add an existing vector field object to chart.
FGAPI fg_err fg_add_image_to_chart (fg_image *pImage, fg_chart pHandle, const unsigned pWidth, const unsigned pHeight, const fg_channel_format pFormat, const fg_dtype pType)
 Create and add an Image object to the current chart.
FGAPI fg_err fg_add_histogram_to_chart (fg_histogram *pHistogram, fg_chart pHandle, const unsigned pNBins, const fg_dtype pType)
 Create and add an Histogram object to the current chart.
FGAPI fg_err fg_add_plot_to_chart (fg_plot *pPlot, fg_chart pHandle, const unsigned pNPoints, const fg_dtype pType, const fg_plot_type pPlotType, const fg_marker_type pMarkerType)
 Create and add an Plot object to the current chart.
FGAPI fg_err fg_add_surface_to_chart (fg_surface *pSurface, fg_chart pHandle, const unsigned pXPoints, const unsigned pYPoints, const fg_dtype pType, const fg_plot_type pPlotType, const fg_marker_type pMarkerType)
 Create and add an Plot object to the current chart.
FGAPI fg_err fg_add_vector_field_to_chart (fg_vector_field *pField, fg_chart pHandle, const unsigned pNPoints, const fg_dtype pType)
 Create and add an Vector Field object to the current chart.
FGAPI fg_err fg_render_chart (const fg_window pWindow, const fg_chart pChart, const int pX, const int pY, const int pWidth, const int pHeight)
 Render the chart to given window.
FGAPI fg_err fg_get_chart_type (fg_chart_type *pChartType, const fg_chart pChart)
 Render the type of a chart.

Detailed Description

Function Documentation

◆ fg_add_histogram_to_chart()

FGAPI fg_err fg_add_histogram_to_chart ( fg_histogram * pHistogram,
fg_chart pHandle,
const unsigned pNBins,
const fg_dtype pType )

Create and add an Histogram object to the current chart.

Parameters
[out]pHistogramis the handle of the histogram object created
[in]pHandleis chart handle
[in]pNBinsis number of bins the data is sorted out
[in]pTypetakes one of the values of fg_dtype that indicates the integral data type of histogram data
Returns
fg_err error code

◆ fg_add_image_to_chart()

FGAPI fg_err fg_add_image_to_chart ( fg_image * pImage,
fg_chart pHandle,
const unsigned pWidth,
const unsigned pHeight,
const fg_channel_format pFormat,
const fg_dtype pType )

Create and add an Image object to the current chart.

Parameters
[out]pImageis the handle of the image object created
[in]pHandleis chart handle to which image object will be added.
[in]pWidthWidth of the image
[in]pHeightHeight of the image
[in]pFormatColor channel format of image, uses one of the values of fg_channel_format
[in]pTypetakes one of the values of fg_dtype that indicates the integral data type of histogram data
Returns
fg_err error code

◆ fg_add_plot_to_chart()

FGAPI fg_err fg_add_plot_to_chart ( fg_plot * pPlot,
fg_chart pHandle,
const unsigned pNPoints,
const fg_dtype pType,
const fg_plot_type pPlotType,
const fg_marker_type pMarkerType )

Create and add an Plot object to the current chart.

Parameters
[out]pPlotis the handle of the plot object created
[in]pHandleis chart handle
[in]pNPointsis number of data points to display
[in]pTypetakes one of the values of fg_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 fg_plot_type
[in]pMarkerTypeindicates which symbol is rendered as marker. It can take one of the values of fg_marker_type.
Returns
fg_err error code

◆ fg_add_surface_to_chart()

FGAPI fg_err fg_add_surface_to_chart ( fg_surface * pSurface,
fg_chart pHandle,
const unsigned pXPoints,
const unsigned pYPoints,
const fg_dtype pType,
const fg_plot_type pPlotType,
const fg_marker_type pMarkerType )

Create and add an Plot object to the current chart.

Parameters
[out]pSurfaceis the handle of the surface object created
[in]pHandleis chart handle
[in]pXPointsis number of data points along X dimension
[in]pYPointsis number of data points along Y dimension
[in]pTypetakes one of the values of fg_dtype that indicates the integral data type of plot data
[in]pPlotTypeis the render type which can be one of fg_plot_type (valid choices are FG_PLOT_SURFACE and FG_PLOT_SCATTER)
[in]pMarkerTypeis the type of fg_marker_type to draw for FG_PLOT_SCATTER plot type
Returns
fg_err error code

◆ fg_add_vector_field_to_chart()

FGAPI fg_err fg_add_vector_field_to_chart ( fg_vector_field * pField,
fg_chart pHandle,
const unsigned pNPoints,
const fg_dtype pType )

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

Parameters
[out]pFieldis the handle of the Vector Field object created
[in]pHandleis chart handle
[in]pNPointsis number of data points to display
[in]pTypetakes one of the values of fg_dtype that indicates the integral data type of vector field data
Returns
fg_err error code

◆ fg_append_histogram_to_chart()

FGAPI fg_err fg_append_histogram_to_chart ( fg_chart pChart,
fg_histogram pHistogram )

Add an existing histogram object to chart.

Parameters
[in]pChartis the chart to which histogram has to be added
[in]pHistogramis the histogram to be added to the chart
Returns
fg_err error code

◆ fg_append_image_to_chart()

FGAPI fg_err fg_append_image_to_chart ( fg_chart pChart,
fg_image pImage )

Add an existing image object to chart.

Parameters
[in]pChartis the chart to which image has to be added
[in]pImageis the image to be added to the chart
Returns
fg_err error code

◆ fg_append_plot_to_chart()

FGAPI fg_err fg_append_plot_to_chart ( fg_chart pChart,
fg_plot pPlot )

Add an existing plot object to chart.

Parameters
[in]pChartis the chart to which plot has to be added
[in]pPlotis the plot to be added to the chart
Returns
fg_err error code

◆ fg_append_surface_to_chart()

FGAPI fg_err fg_append_surface_to_chart ( fg_chart pChart,
fg_surface pSurface )

Add an existing surface object to chart.

Parameters
[in]pChartis the chart to which surface has to be added
[in]pSurfaceis the surface to be added to the chart
Returns
fg_err error code

◆ fg_append_vector_field_to_chart()

FGAPI fg_err fg_append_vector_field_to_chart ( fg_chart pChart,
fg_vector_field pField )

Add an existing vector field object to chart.

Parameters
[in]pChartis the chart to which vector field has to be added
[in]pFieldis the vector field to be added to the chart
Returns
fg_err error code

◆ fg_create_chart()

FGAPI fg_err fg_create_chart ( fg_chart * pHandle,
const fg_chart_type pChartType )

Create a Chart object with given dimensional property.

Parameters
[out]pHandlewill be set to point to the chart object in memory
[in]pChartTypeis chart dimension property
Returns
fg_err error code

◆ fg_get_chart_axes_limits()

FGAPI fg_err fg_get_chart_axes_limits ( float * pXmin,
float * pXmax,
float * pYmin,
float * pYmax,
float * pZmin,
float * pZmax,
const fg_chart pHandle )

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
[in]pHandleis chart handle

◆ fg_get_chart_type()

FGAPI fg_err fg_get_chart_type ( fg_chart_type * pChartType,
const fg_chart pChart )

Render the type of a chart.

Parameters
[out]pChartTypereturn the type of the chart
[in]pChartis chart handle
Returns
fg_err error code

◆ fg_release_chart()

FGAPI fg_err fg_release_chart ( fg_chart pHandle)

Destroy the chart object.

Parameters
[in]pHandleis chart handle
Returns
fg_err error code

◆ fg_render_chart()

FGAPI fg_err fg_render_chart ( const fg_window pWindow,
const fg_chart pChart,
const int pX,
const int pY,
const int pWidth,
const int pHeight )

Render the chart to given window.

Parameters
[in]pWindowis target window to where chart will be rendered
[in]pChartis chart handle
[in]pXis x coordinate of origin of viewport in window coordinates
[in]pYis y coordinate of origin of viewport in window coordinates
[in]pWidthis the width of the viewport
[in]pHeightis the height of the viewport
Returns
fg_err error code

◆ fg_retain_chart()

FGAPI fg_err fg_retain_chart ( fg_chart * pOut,
fg_chart pChart )

Increase reference count for the chart resource.

Parameters
[out]pOutis new reference to existing resource
[in]pChartis the existing chart resource handle
Returns
fg_err error code

◆ fg_set_chart_axes_limits()

FGAPI fg_err fg_set_chart_axes_limits ( fg_chart pHandle,
const float pXmin,
const float pXmax,
const float pYmin,
const float pYmax,
const float pZmin,
const float pZmax )

Set axes data ranges.

Parameters
[in]pHandleis chart handle
[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

◆ fg_set_chart_axes_titles()

FGAPI fg_err fg_set_chart_axes_titles ( fg_chart pHandle,
const char * pX,
const char * pY,
const char * pZ )

Set axes titles for the chart.

Parameters
[in]pHandleis chart handle
[in]pXis x-axis title label
[in]pYis y-axis title label
[in]pZis z-axis title label
Returns
fg_err error code

◆ fg_set_chart_label_format()

FGAPI fg_err fg_set_chart_label_format ( fg_chart pHandle,
const char * pXFormat,
const char * pYFormat,
const char * pZFormat )

Set the format for display of axes labels in a chart.

Parameters
[in]pHandleis chart handle
[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

◆ fg_set_chart_legend_position()

FGAPI fg_err fg_set_chart_legend_position ( fg_chart pHandle,
const float pX,
const float pY )

Set legend position for Chart.

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