Creating a chart from a RESTful web service's response
You can use the response of a RESTful web service as the source data of your chart. To do this, follow the steps below:
- Open the Chart wizard by clicking on the chart button of an existing column.
- In the appearing dialog, you may choose which type of data to build the chart from. Choose REST.
-
Provide the details of the REST endpoint so that the report can generate the appropriate request for it. The fields you need to provide in order are:
- The URL of the REST endpoint
- The request method to use when sending the request
- The headers of the request to be sent (optional)
- The array property that will be used in the chart; leave this blank if the root element of the response body is the array you want to use
- The name of the additional property you want to add to your array objects (optional)
-
The value of the additional property you want to add to your array objects (optional)
You can use the
item
property to reference an object in the array. For example, an extra property namedlabel
whose value is set toitem.month.toUpperCase()
will change the array object from:1 2 3 4
{ "month": "January", "value": 23482 }
... to:
1 2 3 4 5
{ "month": "January", "value": 23482, "label": "JANUARY" }
-
The property that should be displayed in the y-axis, which is typically a property with numerical values.
- The property that should be displayed in the x-axis, which is typically hold the labels of the properties in the y-axis.
Preview your RESTful web service's response
If a request can be successfully made, you will be able to see the response of your endpoint in the Response panel, located on the top right side of the Chart wizard.
-
Pick the type of chart you want to use, and specify a name for your chart.
- Click Generate Report to finalize your work.