Spend less time accessing data from proprietary REST APIs and more time building cool apps with this short tutorial.
A picture is worth a thousand words—especially when you're trying to gain insights from your organization’s data to help you overcome different challenges. Today, most organizations have their data in Big Data, SaaS or Relational data sources and use different analytics tools to visualize their data.
Conventionally, most of these tools need a driver for your data source to connect, fetch and visualize the data, and these operations can be done only on specific platforms. With an increase in computational power on most of the platforms, you would want to create visualizations on mobile devices or on any platform of your choice—but are you limited by the connectivity solution to your data source?
OData allows developers to spend less time accessing data from proprietary REST APIs and more time building cool apps. Using a standard REST API, developers connect to an ecosystem of data sources.
To demonstrate the above scenario, Saikrishna Teja Bobba, a Developer Evangelist from Progress, has created a Node.js based web application that uses DataDirect Cloud’s services to connect, fetch the data from 50+ data sources and visualize them using D3.js, a JavaScript library to generate dynamic visualizations. You can access the web application here, which you can use on any platform to create simple bar charts.
The following tutorial shows you how he built a simple visualization application that can be used by anyone.
var httpRequest = new XMLHttpRequest();
httpRequest.onreadystatechange = function () {
parseResponse(httpRequest)
}
httpRequest.open("GET", URL, true);
httpRequest.setRequestHeader("Authorization", "Basic " + btoa(username + ":" + password));
httpRequest.send(null);
<
script
src
=
"https://d3js.org/d3.v3.min.js"
charset
=
"utf-8"
></
script
>
Below is a code snippet to generate a basic bar chart:
d3.select('#bar-chart').append('svg')
.attr('width', 720)
.attr('height', 400)
.style('background', '#dff0d8')
.selectAll('rect').data(chartdata)
.enter().append('rect')
.style({'fill': '#3c763d', 'stroke': '#d6e9c6', 'stroke-width': '5'})
.attr('width', 40)
.attr('height', function (data) {
return data;
})
.attr('x', function (data, i) {
return i * (40 + 20);
})
.attr('y', function (data) {
return 400 - data;
});
//chartdata is an array of values that you would like to represent as a bar chart
For more tutorials on using D3.js to generate visualizations, you can visit this page.
Feel free to try this application and generate simple bar charts on Mobile, PC or any other platform. The code for this application has been pushed to Github for your reference.
This web application is a simple example of how useful DataDirect Cloud’s REST and OData services can be used when you are developing applications that can be used on multiple platforms. In fact, you can also use this approach to create a hybrid mobile app using the Telerik Mobile platform that can be installed on iOS, Android and Windows to generate various visualizations.
With access to over 50+ data sources including core back office business systems running on Oracle, IBM DB2 or Microsoft SQL Server, the possibilities are unlimited with DataDirect Cloud services. Get a DataDirect Cloud trial and spend less time getting data and more time showing it off.Technology researcher, thought leader and speaker working to enable enterprises to rapidly adopt new technologies that are adaptive, connected and cognitive. Sumit has been working in the data access infrastructure field for over 10 years servicing web/mobile developers, data engineers and data scientists. His primary areas of focus include cross platform app development, serverless architectures, and hybrid enterprise data management that supports open standards such as ODBC, JDBC, ADO.NET, GraphQL, OData/REST. He has presented dozens of technology sessions at conferences such as Dreamforce, Oracle OpenWorld, Strata Hadoop World, API World, Microstrategy World, MongoDB World, etc.
Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.
Learn MoreSubscribe to get all the news, info and tutorials you need to build better business apps and sites