This function allows you to create a graph as defined by the graph data array.
Parameter | Type | Optional | Description | Details |
---|---|---|---|---|
graph data | array or object | Array of Graph objects or a single object with additional parameter gitems, array of graph item objects | graphid shouldn't be specified |
See also graph item details.
Parameter | Description |
---|---|
result | Operation successful. Result will contain array of created Graph IDs. graphid are assigned to each Graph object |
error | In case of any errors |
Create new graph
{
"jsonrpc":"2.0",
"method":"graph.create",
"params":[{
"gitems":[{
"itemid":"100100000018469",
"drawtype":"0",
"sortorder":"0",
"color":"999900",
"yaxisside":"0",
"calc_fnc":"2",
"type":"0",
"periods_cnt":"5"
},{
"itemid":"100100000018468",
"drawtype":"0",
"sortorder":"1",
"color":"009900",
"yaxisside":"0",
"calc_fnc":"2",
"type":"0",
"periods_cnt":"5"
},{
"itemid":"100100000018467",
"drawtype":"0",
"sortorder":"2",
"color":"990000",
"yaxisside":"0",
"calc_fnc":"2",
"type":"0",
"periods_cnt":"5"
}],
"name":"CPU Loads",
"width":"900",
"height":"200",
"yaxismin":"0.0000",
"yaxismax":"3.0000",
"templateid":"0",
"show_work_period":"1",
"show_triggers":"1",
"graphtype":"0",
"show_legend":"0",
"show_3d":"0",
"percent_left":"0.0000",
"percent_right":"0.0000",
"ymin_type":"0",
"ymax_type":"0",
"ymin_itemid":"0",
"ymax_itemid":"0"
}],
"auth":"038e1d7b1735c6a5436ee9eae095879e",
"id":2
}
Graph created successfully:
Graph already exists: