# Graph

### Methods

Class containing methods for operations with Graphs.

|Methods|Description|
|-------|-----------|
|[get()](/api/graph/get)|Get graph details|
|[exists()](/api/graph/exists)|Check if graph exists|
|[create()](/api/graph/create)|Create graphs|
|[update()](/api/graph/update)|Update graph details|
|[delete()](/api/graph/delete)|Delete graphs|

### Object details

The table contains complete list of Graph attributes.

|Parameter|Type|Description|Details|
|---------|----|-----------|-------|
|graphid|*integer*|Graph ID|<|
|name|*string*|Graph name.|<|
|width|*integer*|Width.|<|
|height|*integer*|Height.|<|
|yaxismin|*integer*|Y axis min value.|<|
|yaxismax|*integer*|Y axis max value.|<|
|templateid|*integer*|Parent graph **ID**.|<|
|show\_work\_period|*integer*|Show work period.|<|
|show\_triggers|*integer*|Show items triggers if possible|<|
|graphtype|*integer*|Chart or Pie.|<|
|show\_legend|*integer*|Show legend for pie graphs.|<|
|show\_3d|*integer*|Show pie graph in 3D view.|<|
|percent\_left|*float*|Show percentile line (left).|<|
|percent\_right|*float*|Show percentile line (right).|<|
|ymin\_type|*integer*|Y axis min limitation type.|Calculated, user defined, by item value.|
|ymax\_type|*integer*|Y axis max limitation type.|Calculated, user defined, by item value.|
|ymin\_itemid|*integer*|Y axis min limitation by Item **ID**.|<|
|ymax\_itemid|*integer*|Y axis max limitation by Item **ID**.|<|

### Field values

#### Y axis min/max type

|Value|Type|
|-----|----|
|0|Calculated|
|1|Fixed|
|2|By item value|

### Common tasks

The table contains list of common graph-related tasks and possible
implementation using Zabbix API

|Task|HOWTO|
|----|-----|
|Add a graph|Use method **graph.create**|
|Add a bunch of new graphs|Use method **graph.create** with array of Graph objects|
|Remove graph by Graph IDs|Use method **graph.delete** array of Graph **IDs**|
|Retrieve graph details by Graph IDs|Use method **graph.get** with parameter **graphids**|
|Retrieve graph details by Graph name|Use method **graph.get** with parameter **filter**, specify **"name":"<your graph>"**|
