chart
This endpoint allows to use chart core module
render
request
POST /chart/render
Request body format:
Series data:
see chart module documentation about series data format
Data:
Example
curl -X "POST" "http://127.0.0.1:2020/chart/render" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"title": "FooBar",
"series": [
{
"data": [
{
"value": 95,
"timestamp": 12345646554
},
{
"value": 94,
"timestamp": 12345646555
}
]
}
]
}'
Its request is analogous to the following lua script:
script.lua
local ch = require("chart")
data = {
title = "FooBar",
series = {
{
data = {
{
value = 95,
timestamp = 12345646554
},
{
value = 94,
timestamp = 12345646555
}
}
}
}
}
result = ch.render(data)
response
Chart response image: