9 Graph (classic)

Description

These parameters and the possible property values for the respective dashboard widget field objects allow to configure the Graph (classic) widget in dashboard.create and dashboard.update methods.

Parameters

The following parameters are supported for the Graph (classic) widget.

Parametertypenamevalue
Refresh interval0rf_rate0 - No refresh;
10 - 10 seconds;
30 - 30 seconds;
60 - (default) 1 minute;
120 - 2 minutes;
600 - 10 minutes;
900 - 15 minutes.
Source0source_type0 - (default) Graph;
1 - Simple graph.
Graph6graphidGraph ID.

Parameter behavior:
- required if Source is set to “Graph”
Item4itemidItem ID.

Parameter behavior:
- required if Source is set to “Simple graph”
Show legend0show_legend0 - Disabled;
1 - (default) Enabled.
Enable host selection0dynamic0 - (default) Disabled;
1 - Enabled.

Examples

The following examples aim to only describe the configuration of the dashboard widget field objects for the Graph (classic) widget. For more information on configuring a dashboard, see dashboard.create.

Configuring a Graph (classic) widget

Configure a Graph (classic) widget that displays a simple graph for the item “42269”.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "dashboard.create",
  4. "params": {
  5. "name": "My dashboard",
  6. "display_period": 30,
  7. "auto_start": 1,
  8. "pages": [
  9. {
  10. "widgets": [
  11. {
  12. "type": "graph",
  13. "name": "Graph (classic)",
  14. "x": 0,
  15. "y": 0,
  16. "width": 12,
  17. "height": 5,
  18. "view_mode": 0,
  19. "fields": [
  20. {
  21. "type": 0,
  22. "name": "source_type",
  23. "value": 1
  24. },
  25. {
  26. "type": 4,
  27. "name": "itemid",
  28. "value": 42269
  29. }
  30. ]
  31. }
  32. ]
  33. }
  34. ],
  35. "userGroups": [
  36. {
  37. "usrgrpid": 7,
  38. "permission": 2
  39. }
  40. ],
  41. "users": [
  42. {
  43. "userid": 1,
  44. "permission": 3
  45. }
  46. ]
  47. },
  48. "id": 1
  49. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "dashboardids": [
  5. "3"
  6. ]
  7. },
  8. "id": 1
  9. }

See also