Skip to content

Commit

Permalink
Fixes issue w3c#83
Browse files Browse the repository at this point in the history
  • Loading branch information
almossawi committed May 30, 2014
1 parent 6909933 commit 754e274
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
4 changes: 4 additions & 0 deletions css/metrics-graphics-darkness.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ h2.chart_title span {
fill: #fff;
}

.main-area-solid svg .main-area {
fill: #52491f;
}

.missing {
background-image: url(../images/missing-data-dark.png);
}
Expand Down
5 changes: 5 additions & 0 deletions css/metrics-graphics.css
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ h2.chart_title .fa {
width: 400px;
}

.main-area-solid svg .main-area {
fill: #ccccff;
opacity: 1;
}

.markers line {
opacity: 0.2;
shape-rendering: crispEdges;
Expand Down
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@
<div id='torso'>
<div id='fake_users1'></div>
<div id='fake_users2'></div>
<div id='glorious_chart' class='missing'></div>
<div id='spike' class='main-area-solid'></div>
<div id='percentage'></div>
<div id='currency'></div>
<div id='xnotdate'></div>
<div id='glorious_chart' class='missing'></div>
</div>
<div id='trunk'>
<div class='row trunk-section'>
Expand Down
18 changes: 18 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,24 @@ $(document).ready(function() {
x_accessor: 'date',
y_accessor: 'value'
})

var markers = [{
'date': new Date('2014-03-17'),
'label': 'Look, a spike!'
}]

moz_chart({
title: "Annotations",
description: "By setting the chart's target a class name of main-area-solid, markers don't extend down to the bottom of the chart, which better draws attention to, say, spikes.",
data: data,
width: torso.width,
height: torso.height,
right: torso.right,
markers: markers,
target: '#spike',
x_accessor: 'date',
y_accessor: 'value'
})
})

d3.json('data/fake_users2.json', function(data) {
Expand Down

0 comments on commit 754e274

Please sign in to comment.