The Google Chart API lets you dynamically generate charts with a URL string and embed these charts on a web page, or download the image for local or offline use. The Google Chart Tools enable adding live charts to any web page. They provide advantages such as a rich gallery of visualizations provided as image charts and interactive charts and they can read live data from a variety of data sources. Users embed the data and formatting parameters in an HTTP request, and Google returns a PNG image of the chart. Many types of chart are supported, and by making the request into an image tag the chart can be included in a web page.
Google Chart API
Install the following,
Step1 - Create a web app with .NET
Open the DemoGoogleChart folder in Visual Studio Code (VS Code) and select the Startup.cs file.
Press Debug (F5) to build and run the program.
VS Code starts the Kestrel web server and runs your app. Notice that the address bar shows localhost:5000 .
localhost:5000
Step2
In VS Code, select the EXPLORER icon and then control-click (right-click) Controllers > New File and name the new file as PopulationController.cs.
Add the following code.
Step4
Return JSON Data from InMemory collection. Here, we can write the code to pull the data from different sources; i.e. DB or XML.
Step5 Select the EXPLORER icon and then control-click (right-click) Views > New File and name the new file as Index.cshtml. Here, copy the below code.
Step 6
Edit the Views/Shared/_Layout page to add new menu; i.e. US Population Chart.
Step 7 Now, run the application and click on the Players list from the start page.
That's it. Thanks for reading.
Pro WPF: Windows Presentation Foundation in .NET 3.0