cdk_graph (3) Linux Manual Page
NAME
cdk_graph – curses graph widget
SYNOPSIS
cc [ flag … ] file … -lcdk [ library … ]
#include <cdk.h>
void activateCDKGraph(
CDKGRAPH *graph,
chtype *unused);
void destroyCDKGraph(
CDKGRAPH *graph);
void drawCDKGraph(
CDKGRAPH *graph,
boolean box);
void eraseCDKGraph(
CDKGRAPH *graph);
boolean getCDKGraphBox(
CDKGRAPH *graph);
chtype getCDKGraphCharacter(
CDKGRAPH *graph,
int index);
chtype *getCDKGraphCharacters(
CDKGRAPH *graph);
EGraphDisplayType getCDKGraphDisplayType(
CDKGRAPH *graph);
int getCDKGraphValue(
CDKGRAPH *graph,
int index);
int *getCDKGraphValues(
CDKGRAPH *graph,
int *size);
void moveCDKGraph(
CDKGRAPH *graph,
int xpos,
int ypos,
boolean relative,
boolean refresh);
CDKGRAPH *newCDKGraph(
CDKSCREEN *cdkscreen,
int xpos,
int ypos,
int height,
int width,
const char *title,
const char *xtitle,
const char *ytitle);
void positionCDKGraph(
CDKGRAPH *graph);
int setCDKGraph(
CDKGRAPH *graph,
int *values,
int valueCount,
const char *graphCharacters,
boolean startAtZero,
EGraphDisplayType displayType);
void setCDKGraphBackgroundAttrib(
CDKGRAPH *graph,
chtype attribute);
void setCDKGraphBackgroundColor(
CDKGRAPH *graph,
const char *color);
void setCDKGraphBox(
CDKGRAPH *graph,
boolean box);
void setCDKGraphBoxAttribute(
CDKGRAPH *graph,
chtype character);
int setCDKGraphCharacter(
CDKGRAPH *graph,
int index,
const char *graphCharacter);
int setCDKGraphCharacters(
CDKGRAPH *graph,
const char *graphCharacters);
void setCDKGraphDisplayType(
CDKGRAPH *graph,
EGraphDisplayType type);
void setCDKGraphHorizontalChar(
CDKGRAPH *graph,
chtype character);
void setCDKGraphLLChar(
CDKGRAPH *graph,
chtype character);
void setCDKGraphLRChar(
CDKGRAPH *graph,
chtype character);
void setCDKGraphULChar(
CDKGRAPH *graph,
chtype character);
void setCDKGraphURChar(
CDKGRAPH *graph,
chtype character);
int setCDKGraphValue(
CDKGRAPH *graph,
int index,
int value,
boolean startAtZero);
int setCDKGraphValues(
CDKGRAPH *graph,
int *values,
int valueCount,
boolean startAtZero);
void setCDKGraphVerticalChar(
CDKGRAPH *graph,
chtype character);
DESCRIPTION
The Cdk graph widget creates a graph in either X/Y plot or line mode. The following functions create or manipulate the Cdk graph box widget.
AVAILABLE FUNCTIONS
activateCDKGraph- this is an obsolete function that calls
drawCDKGraph. destroyCDKGraph- removes the widget from the screen and frees memory the object used.
drawCDKGraph- draws the graph widget on the screen. The
boxoption tells whether to draw the widget with a box. eraseCDKGraph- removes the widget from the screen. This does NOT destroy the widget.
getCDKGraphBox- returns true if the widget will be drawn with a box around it.
getCDKGraphCharacter- returns the character in the graph at the given index.
getCDKGraphCharacters- returns all the characters currently in the graph widget.
getCDKGraphDisplayType- returns the current display type of the widget.
getCDKGraphValue- returns the value in the graph at the given index.
getCDKGraphValues- returns all the values currently in the graph widget.
moveCDKGraph- moves the given widget to the given position. The parameters
xposandyposare the new position of the widget. The parameterxposmay be an integer or one of the pre-defined values TOP, BOTTOM, and CENTER. The parameteryposmay be an integer or one of the pre-defined values LEFT, RIGHT, and CENTER. The parameterrelativestates whether thexpos/ypospair is a relative move or an absolute move. For example, ifxpos= 1 andypos= 2 andrelative=TRUE, then the widget would move one row down and two columns right. If the value ofrelativewasFALSEthen the widget would move to the position (1,2). Do not use the values TOP, BOTTOM, LEFT, RIGHT, or CENTER whenrelative= TRUE. (weird things may happen). The final parameterrefreshis a boolean value which states whether the widget will get refreshed after the move. newCDKGraph- creates a pointer to a graph widget. Parameters:
-
screen- is the screen you wish this widget to be placed in.
xpos- controls the placement of the object along the horizontal axis. It may be an integer or one of the pre-defined values LEFT, RIGHT, and CENTER.
ypos- controls the placement of the object along the vertical axis. It may be an integer or one of the pre-defined values TOP, BOTTOM, and CENTER.
heightandwidth- control the height and width of the widget. If you provide a zero for either of the height or the width, the widget will be created with the full width and height of the screen. If you provide a negative value, the widget will be created the full height or width minus the value provided.
title,xtitleandytitle- are the graph title, the X axis title, and the Y axis title respectively. The graph title may be more than one line by providing a carriage return character at the line break.
- If the widget could not be created then a NULL pointer is returned.
positionCDKGraph- allows the user to move the widget around the screen via the cursor/keypad keys. See
cdk_position (3)for key bindings. setCDKGraph- lets the programmer set the specific values of the graph widget. The parameter
valuesis an integer array of the values to display in the widget;valueCountis the number of values in the array. The parametergraphCharactersis an array of the characters to use for each graph point. The parameterstartAtZerostates whether you want the graph to start at zero or the lowest values of the X and Y axis’. The parameterdisplayTypemay be vPLOT, to make the graph draw the values as a plot graph, or vLINE to draw the values as a line graph. setCDKGraphBackgroundAttrib- sets the background attribute of the widget. The parameter
attributeis a curses attribute, e.g., A_BOLD. setCDKGraphBackgroundColor- sets the background color of the widget. The parameter
coloris in the format of the Cdk format strings. Seecdk_display (3). setCDKGraphBox- sets whether the widget will be drawn with a box around it.
setCDKGraphBoxAttribute- function sets the attribute of the box.
setCDKGraphCharacter- lets the programmer set a specific character of the graph widget. The parameter
characteris the new character, whileindexis the index where the new character will be stored. setCDKGraphCharacters- lets the programmer set the specific characters of the graph widget. The parameter
charactersis a char pointer array of the characters to display in the widget. setCDKGraphDisplayType- allows the programmer tochange the way the graph draws itself. The parameter
displayTypemay be vPLOT, to make the graph draw the values as a plot graph, or vLINE to draw the values as a line graph. setCDKGraphHorizontalChar- sets the horizontal drawing character for the box to the given character.
setCDKGraphLLChar- sets the lower left hand corner of the widget’s box to the given character.
setCDKGraphLRChar- sets the lower right hand corner of the widget’s box to the given character.
setCDKGraphULChar- sets the upper left hand corner of the widget’s box to the given character.
setCDKGraphURChar- sets the upper right hand corner of the widget’s box to the given character.
setCDKGraphValue- lets the programmer set a specific value of the graph widget. The parameter
valueis the new value, whileindexis the index where the new value will be stored. The parameterstartAtZerostates whether you want the graph to start at zero or the lowest values of the X and Y axis. setCDKGraphValues- lets the programmer set the specific values of the graph widget. The parameter
valuesis an integer array of the values to display in the widget; wherevalueCountis the number of values in the array. The parameterstartAtZerostates whether you want the graph to start at zero or the lowest values of the X and Y axis’. setCDKGraphVerticalChar- sets the vertical drawing character for the box to the given character.
SEE ALSO
cdk(3), cdk_binding(3), cdk_display(3), cdk_position(3), cdk_screen(3)
