[comment]: # translation:outdated

[comment]: # ({000fdd04-000fdd04})
# graph.create

[comment]: # ({/000fdd04-000fdd04})

[comment]: # ({c0a9ce2e-e0ee1e5d})
### Опис

`object graph.create(object/array graphs)`

Овај метод омогућава креирање нових графикона.

::: noteclassic
Ова метода је доступна само типовима корисника *Админ* и *Супер админ*. Дозволе за позивање методе могу се опозвати у подешавањима улога корисника. Погледајте [[Userroles](/manual/web_interface/frontend_sections/users/user_roles) за више информација.

[comment]: # ({/c0a9ce2e-e0ee1e5d})

[comment]: # ({a3a03cd9-fc8b02f4})
### Параметери

`(object/array)` Графови за креирање. 

Поред [standard graph properties](object#graph),  метод прихвата следеће параметре.

|Parameter|[Type](/manual/api/reference_commentary#data_types)|Опис|
 |--|--|------|
|gitems|array|[Graph items](/manual/api/reference/graphitem/object) који ће се креирати за графикон.<br><br>[Parameter behavior](/manual/api/reference_commentary#parameter-behavior):<br>- *обавезно*|

[comment]: # ({/a3a03cd9-fc8b02f4})

[comment]: # ({d64b873d-d64b873d})
### Повратне вредности

`(object)`  Враћа објекат који садржи ID-ијеве креираног графикона испод својства `graphids `. Редослед враћених ID-ијева одговара редоследу прослеђених графикона.

[comment]: # ({/d64b873d-d64b873d})

[comment]: # ({b41637d2-b41637d2})
### Примери

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({a5d4a0e3-cd12048c})
#### Креирање графикона

Направите графикон са две ставке.

[Request](/manual/api#performing-requests):

```json
{
     "jsonrpc": "2.0",
     "method": "graph.create",
     "params": {
     "name": "MySQL bandwidth",
     "width": 900,
     "height": 200,
     "gitems": [
     {
     "itemid": "22828",
     "color": "00AA00"
     },
     {
     "itemid": "22829",
     "color": "3333FF"
     }
     ]
     },
     "id": 1
}
```

Одговор:

```json
{
     "jsonrpc": "2.0",
     "result": {
     "graphids": [
     "652"
     ]
     },
     "id": 1
}
```

[comment]: # ({/a5d4a0e3-cd12048c})

[comment]: # ({88266563-88266563})
### Погледајте такође

– [Graph item](/manual/api/reference/graphitem/object#graph_item)

[comment]: # ({/88266563-88266563})

[comment]: # ({4e535c8e-4e535c8e})
### Извор

CGraph::create() in *ui/include/classes/api/services/CGraph.php*.

[comment]: # ({/4e535c8e-4e535c8e})
