Charting and You
At some point, you'll be called upon to prepare a series of graphs, or charts for your business. It's scary at first; where do you even begin? But, luckily, you'll find that, thanks to tools like Chart.js, it has never been easier to accomplish such a task. I'll show you how, one easy-to-understand step at a time.
Progress
Series Info
- Episodes
- 8
- Run Time
- 1h 17m
- Difficulty
- Intermediate
- Last Updated
- Apr 19, 2016
- Version
- Latest
Series Episodes
- Episodes (8)
Line Graph in 5 Minutes
Let's begin with the "hello world" of graphs, using the excellent Chart.js library.Leveraging NPM, Browserify, and Elixir
Let's take another step. What if we pull Chart.js in through NPM, and then leverage Browserify, so that we may write modern ES6+ code? Let's get started on that workflow in this episode.A Graph Vue Component
Let's continue working on structure, as we create a reusablegraphVue component. If you've worked your way through any of the Vue series at Laracasts, this should all be a cinch!Legends
Chart.js can automatically generate a chart "legend" for you; however, it's up to you to insert it into the DOM and add any applicable styling. I'll show you the basic workflow in this lesson.Dedicated Graph Vue Components
In this lesson, we'll create a masterGraphcomponent, to which all other specific graphs may extend. This way, we may use custom properties that are unique to each type of graph that are application requires.Render Monthly Revenue
Imagine that your boss assigns you the task of rendering a graph to display the company's monthly revenue. Well, it sounds like we'll need to perform the proper database query (which groups and sums the revenue for the month), and then we'll of course pass that data to ourgraphcomponent. Let's get started.Graphs and AJAX
Now what if you want your graph to instead fire an AJAX request to fetch your desired data? No problem! Let's add aurlcustom property to ourgraphcomponent, and then leverage the Vue Resource plugin to perform the request.Dynamic Graphs
How might we make our graphs more dynamic? Maybe we want to limit revenue to onlyxnumber of days; and, further, we should be able to modify this range on the fly, without requiring a page reload. Well, I'll show you how!
