const pivot = new WebDataRocks({
container: "#wdr-component",
toolbar: true,
height: 490,
report: {
dataSource:
{
filename: "https://cdn.webdatarocks.com/data/data.csv"
},
options: {
grid: {
title: "REPORT",
showHeaders: false
}
}
}
});
If i try to hit an api inside the filename or data its not working but if i try to call an api in report its working
For Example:
dataSource:
{
data: "http://localhost:8082/getUser"
}
(or)
dataSource:
{
filename: "http://localhost:8082/getUser"
}
instead of csv i want to use api for getting data
When using the WebDataRocks
dataSourceobject, you have two options for defining your data - either use thefilenameproperty to specify the URL of a JSON or CSV file(also can be the URL to the server-side script generating the data) or use thedataproperty to specify JSON data directly. Please ensure that your data is in the correct format, which is an array of objects, with each object containing an unordered collection of key/value pairs.It is important to note that your API endpoint must return the data in the correct format and that it should be available to your application. If you face any issues, it may be due to CORS or other network-related problems.