[comment]: # translation:outdated

[comment]: # ({d2516189-d2516189})
# graph.update

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

[comment]: # ({dbeca218-992bc0de})
### 説明

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

この方法によって、既存のグラフを更新することができます。

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

[comment]: # ({/dbeca218-992bc0de})

[comment]: # ({c695fc44-72c99624})
### パラメータ

`(object/array)` 更新されるグラフのプロパティ

各グラフには `graphid` プロパティを定義する必要があり、その他のプロパティは任意である。渡されたプロパティのみが<br>
更新され、その他のプロパティは変更されません。

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

|パラメータ|[Type](/manual/api/reference_commentary#data_types)|説明|
|--|--|------|
|gitems|array|Graph [items](/manual/api/reference/graphitem/object) to replace existing graph items. If a graph item has the `gitemid` property defined it will be updated, otherwise a new graph item will be created.|

[comment]: # ({/c695fc44-72c99624})

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

`(object)` `graphids` プロパティの下で更新されたグラフのIDを含むオブジェクトを返す。

[comment]: # ({/9a0b4500-9a0b4500})

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

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

[comment]: # ({03801136-7b33f5ce})
#### Y スケールの最大値を設定する

Yスケールの最大値を固定値100に設定します。

Request:

``` {.java}
{
    "jsonrpc": "2.0",
    "method": "graph.update",
    "params": {
        "graphid": "439",
        "ymax_type": 1,
        "yaxismax": 100
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response:

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

[comment]: # ({/03801136-7b33f5ce})

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

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

[comment]: # ({/84b1446b-84b1446b})
