7 Minute Miles

Charting tools for WordPress


This website has included charts on several pages for quite some time: the run log, the bike log and the golf score database have all had various graphs that were created using the Easy Chart Builder plugin by dyerware. It used the original Google Chart API to create a PNG graphic from the information in a shortcode that I updated manually after each new event.

Google deprecated that API in 2012 and according to the Wikipedia page, turned it off on March 18, 2019. For some reason, however, the plugin still worked after that (most of the time). Last week, though, it didn’t work at all. When I went to the Easy Chart Builder support page, I discovered the plugin hadn’t been updated in 11 years. Time to find a replacement, eh?

Google still has a free charting tool called Google Charts and most current WordPress charting plugins use that. I didn’t want to get stuck again with Google deprecating a service in the future, though, so I started looking for alternatives. I found an awesome looking open source graphing library called Chart.js and skimmed through the documentation for that.

Turns out there is a great free plugin that uses Chart.js from Jamie Poitra called M Chart that does everything I want. Jamie has nice documentation here and I was up and running with replacement graphs on all three pages in about an hour. Still need to read up on themes, but I like the default styles and might just leave it the way it is. The Highcharts stuff is interesting – hadn’t heard of that library (or the Norwegian company) before.

M Chart also uses shortcodes, but creates a chart object for each one that is updated like a post or page. Each chart has a spreadsheet-like interface for updating data, so I’ll have to see how I like that workflow. Ideally, I’d like to have the charts update automatically when I enter events into the database, but that is beyond the scope of this plugin. I currently use phpMyAdmin to enter events, so maybe I can tackle that whenever I get around to creating custom data entry screens…

Originally published by DK on April 14, 2024 at 12:26 pm in Biking, Golf, Housekeeping, Longform, Running, Technology


flourish icon