[comment]: # translation:outdated

[comment]: # ({576421be-576421be})
# graphprototype.create

[comment]: # ({/576421be-576421be})

[comment]: # ({fc8d3493-fc8d3493})
### 説明

`object graphprototype.create(object/array graphPrototypes)`

このメソッドに graph prototypes を作成することができます。 

::: noteclassic
このメソッドは、*Admin* および *Super admin* ユーザータイプにのみ使用できます。このメソッドを呼び出す許可は、<br>
ユーザーロール設定で取り消すことができます。詳細については、[User roles](/manual/web_interface/frontend_sections/administration/user_roles)を参照してください。
:::

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

[comment]: # ({378ef202-9beca929})
### パラメータ

`(object/array)` Graph prototypes を作成する。

[standard graph prototype properties](object#graph_prototype)に加えて、このメソッドは以下のパラメータを受け付ける。

|パラメータ|[Type](/manual/api/reference_commentary#data_types)|説明|
|--|--|------|
|**gitems**<br>(required)|array|Graph [items](/manual/api/reference/graphitem/object) to be created for the graph prototypes. Graph items can reference both items and item prototypes, but at least one item prototype must be present.|

[comment]: # ({/378ef202-9beca929})

[comment]: # ({f1317691-f1317691})
### 戻り値

`(object)` `graphids` プロパティの下に作成されたグラフプロトタイプのIDを含むオブジェクトを返します。<br>
返されたIDの順番は、渡されたグラフプロトタイプの順番と一致する。

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

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

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

[comment]: # ({24ec4c22-24ec4c22})
#### graph prototype の作成

2つの項目からなる graph prototype を作成する。

Request:

``` {.java}
{
    "jsonrpc": "2.0",
    "method": "graphprototype.create",
    "params": {
        "name": "Disk space usage {#FSNAME}",
        "width": 900,
        "height": 200,
        "gitems": [
            {
                "itemid": "22828",
                "color": "00AA00"
            },
            {
                "itemid": "22829",
                "color": "3333FF"
            }
        ]
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response:

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

[comment]: # ({/24ec4c22-24ec4c22})

[comment]: # ({88266563-88266563})
### 参照

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

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

[comment]: # ({c4b4834a-c4b4834a})
### ソース

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

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