Using QuickChart API in .NET Core MVC.

Ibrahim Jaber
9 min readJun 28, 2021
Photo by Isaac Smith on Unsplash

If you've ever been in a situation that you got asked to provide a simple visualization of data in your application then look no further. QuickChart is an open-source API that uses the famous library Chart.Js. This service is lightweight and easy to use.

Today, I will walk you through how to generate charts using QuickChart.io API.

LET’S GET STARTED!!

1-Creating our Entities and repository.

For the purpose of this demonstration, I will be using VideoGame and Consoles as our Entities where Many videogames relate to one console.
The data will be in memory and we will mock the database repository pattern.

a-Adding the entities

  • VideoGame
public class VideoGame{public int ID { get; set; }public Rating Rating { get; set; }public string Title { get; set; }public Developers Developer { get; set; }public GameConsole Console { get; set; }}
  • GameConsole
public class GameConsole{public GameConsole(){VideoGames = new List<VideoGame>();}public int ID { get; set; }public string ConsoleName { get; set; }public List<VideoGame> VideoGames { get; set; }}
  • Developers Enum
public enum Developers{  Activison,  EA,  Ubisoft}
  • Rating Enum
public enum Rating{  Good,  Bad,  Great}

b-Adding our Respoitories

  • IBaseRepo

--

--

Ibrahim Jaber

Software developer | Programming and Blockchain enthusiast | If you'd like to buy me coffee: https://ko-fi.com/ibrahimjaber