From 4e7475da73f80b90d4b9b0d44cd7ebb994fdce71 Mon Sep 17 00:00:00 2001 From: Bob Monteverde Date: Thu, 5 Apr 2012 01:24:39 -0400 Subject: [PATCH] Added another layer of abstraction to take care of all the glue and make the chart api extremely simple. First try, so not entirely complete, but does function. --- examples/lineChart.html | 81 ++++++++++++++++ examples/lineWithLegend.html | 135 +++++++++++++-------------- examples/stackedAreaWithLegend.html | 6 +- nv.d3.js | 77 ++++++++++------ nv.d3.min.js | 4 +- src/charts/lineChart.js | 137 ++++++++++++++++++++++++++++ src/core.js | 9 +- src/d3.css | 19 +++- src/models/lineWithLegend.js | 15 +-- src/models/stackedArea.js | 23 ++++- src/models/stackedAreaWithLegend.js | 5 +- 11 files changed, 395 insertions(+), 116 deletions(-) create mode 100644 examples/lineChart.html create mode 100644 src/charts/lineChart.js diff --git a/examples/lineChart.html b/examples/lineChart.html new file mode 100644 index 0000000..9ff1f40 --- /dev/null +++ b/examples/lineChart.html @@ -0,0 +1,81 @@ + + + + + + + + +
+
+ + + + + + + + + + + + diff --git a/examples/lineWithLegend.html b/examples/lineWithLegend.html index e28c7ec..5d200f9 100644 --- a/examples/lineWithLegend.html +++ b/examples/lineWithLegend.html @@ -13,11 +13,22 @@ text { font: 12px sans-serif; } +#chart1 { + height: 500px; + margin: 10px; + min-width: 100px; + min-height: 100px; +/* + Minimum height and width is a good idea to prevent negative SVG dimensions... + For example width should be =< margin.left + margin.right + 1, + of course 1 pixel for the entire chart would not be very useful, BUT should not have errors +*/ +} + -
- +
@@ -31,86 +42,76 @@ text {