From 4a29c0e001f0dcdbf96267ff5902280f159185e4 Mon Sep 17 00:00:00 2001
From: almossawi
moz_chart expects the data object to be an array of objects, which is already the case for us. That's good. It also needs dates to be timestamps if they're in a format like yyyy-mm-dd. We've got aggregated yearly data, so we don't need to worry about that. Otherwise, we'd add a line like this one.
- +d3.json('data/ufo-sightings.json', function(data) {
data = convert_dates(data, 'year');
})
@@ -131,24 +131,25 @@ And this is what we end up with. In this example, we're adding a marker to draw attention to a particular data point. This is optional of course.
It's as easy as that. If for whatever reason we decide to update the data in the chart, we call moz_chart with the updated data object on the same target element. The library will gracefully transition the existing plot to the new one. It's ridiculously easy to modify every aspect of the chart by setting one or more of the available options.
+Take the library out for a spin, file bugs and don't forget to star the project on Github!