From 4a29c0e001f0dcdbf96267ff5902280f159185e4 Mon Sep 17 00:00:00 2001 From: almossawi Date: Thu, 30 Oct 2014 12:21:55 -0700 Subject: [PATCH] Fix issue #171 --- .gitignore | 2 ++ index.htm | 21 +++++++++++---------- js/main.js | 1 + src/common/init.js | 7 +++++++ 4 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..68de538892 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +other/divider.psd diff --git a/index.htm b/index.htm index be53152b46..a47f49b3a1 100644 --- a/index.htm +++ b/index.htm @@ -63,7 +63,7 @@ currently supports line charts, scatterplots and histograms as well as features like rug plots and basic linear regression.

- +
@@ -71,7 +71,7 @@
- +
@@ -107,7 +107,7 @@

Creating your first chart

})

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 @@

Creating your first chart

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!

- + - + - +