Skip to content

Instantly share code, notes, and snippets.

@jes-moore
Created June 13, 2015 07:54
Show Gist options
  • Save jes-moore/8e224791fcb129055131 to your computer and use it in GitHub Desktop.
Save jes-moore/8e224791fcb129055131 to your computer and use it in GitHub Desktop.
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<link rel='stylesheet' href='//cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.css'>
<script src='//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js' type='text/javascript'></script>
<script src='//d3js.org/d3.v3.min.js' type='text/javascript'></script>
<script src='//cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.js' type='text/javascript'></script>
<script src='//nvd3.org/assets/lib/fisheye.js' type='text/javascript'></script>
<style>
.rChart {
display: block;
margin-left: auto;
margin-right: auto;
width: 800px;
height: 400px;
}
</style>
</head>
<body >
<div id = 'chart3a985a4b69ac' class = 'rChart nvd3'></div>
<script type='text/javascript'>
$(document).ready(function(){
drawchart3a985a4b69ac()
});
function drawchart3a985a4b69ac(){
var opts = {
"dom": "chart3a985a4b69ac",
"width": 800,
"height": 400,
"x": "Date",
"y": "Close",
"type": "scatterChart",
"id": "chart3a985a4b69ac"
},
data = [
{
"Date": 16596,
"Headline": "Appendix 3B",
"Page": "13",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01632288",
"Close": 1.08
},
{
"Date": 16589,
"Headline": "Results of Meeting",
"Page": "1",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01630616",
"Close": 1.12
},
{
"Date": 16582,
"Headline": "Brett Lee signs on as Global Brand Ambassador for Zipt",
"Page": "3",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01628514",
"Close": 0.91
},
{
"Date": 16577,
"Headline": "Digital/social media agency secured for Zipt global rollout",
"Page": "3",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01627401",
"Close": 0.73
},
{
"Date": 16567,
"Headline": "ZipT Global Launch",
"Page": "4",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01624427",
"Close": 0.675
},
{
"Date": 16563,
"Headline": "Trading Halt",
"Page": "2",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01623664",
"Close": 0.725
},
{
"Date": 16556,
"Headline": "Notice of General Meeting/Proxy Form",
"Page": "10",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01621986",
"Close": 0.64
},
{
"Date": 16556,
"Headline": "Change of Director's Interest Notice",
"Page": "6",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01621969",
"Close": 0.64
},
{
"Date": 16556,
"Headline": "Appendix 4C - quarterly",
"Page": "9",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01621655",
"Close": 0.64
},
{
"Date": 16545,
"Headline": "Capacity to Issue Equity Securities",
"Page": "2",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01617100",
"Close": 0.6
},
{
"Date": 16527,
"Headline": "Change of Company Secretary and Registered Office",
"Page": "2",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01613681",
"Close": 0.525
},
{
"Date": 16526,
"Headline": "Company Secretary Appointment/Resignation",
"Page": "2",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01613545",
"Close": 0.49
},
{
"Date": 16525,
"Headline": "Independent Research Report on ZipTel Limited",
"Page": "2",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01612653",
"Close": 0.5
},
{
"Date": 16521,
"Headline": "Becoming a substantial holder",
"Page": "6",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01611808",
"Close": 0.515
},
{
"Date": 16493,
"Headline": "Appendix 4D and Half-Year Financial Report and Accounts",
"Page": "27",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01603923",
"Close": 0.47
},
{
"Date": 16483,
"Headline": "ZIP signs Landmark agreement with Global Satellite Provider",
"Page": "3",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01599535",
"Close": 0.515
},
{
"Date": 16479,
"Headline": "Trading Halt",
"Page": "2",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01598669",
"Close": 0.495
},
{
"Date": 16469,
"Headline": "Unauthorised application in Google Play store",
"Page": "2",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01596043",
"Close": 0.425
},
{
"Date": 16468,
"Headline": "Successful completion of ZipT App Phase One Pilot rollout",
"Page": "3",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01595689",
"Close": 0.45
},
{
"Date": 16465,
"Headline": "Appendix 4C - Dec Quarterly and Activities Report",
"Page": "9",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01595052",
"Close": 0.49
},
{
"Date": 16455,
"Headline": "Explosion of Global Traffic to ZipT Website - Revised",
"Page": "2",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01592016",
"Close": 0.51
},
{
"Date": 16455,
"Headline": "Explosion of Global Traffic to ZipT Website",
"Page": "2",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01592009",
"Close": 0.51
},
{
"Date": 16449,
"Headline": "Response to ASX Price and Volume Query",
"Page": "4",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01591169",
"Close": 0.475
},
{
"Date": 16443,
"Headline": "ZipT Pilot Phase Initial Update",
"Page": "2",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01590083",
"Close": 0.385
},
{
"Date": 16427,
"Headline": "Change of Director's Interest Notice - Appendix 3Y",
"Page": "2",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01587663",
"Close": 0.3
},
{
"Date": 16422,
"Headline": "ZipTel Releases Promotional VIP Video for New ZipT App",
"Page": "2",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01586000",
"Close": 0.25
},
{
"Date": 16420,
"Headline": "ZipT Launches App to Over 130,000 Users in Pilot Phase",
"Page": "3",
"PDF": "PDF",
"links": "http://www.asx.com.au/asx/statistics/displayAnnouncement.do?display=pdf&idsId=01585115",
"Close": 0.285
}
]
if(!(opts.type==="pieChart" || opts.type==="sparklinePlus" || opts.type==="bulletChart")) {
var data = d3.nest()
.key(function(d){
//return opts.group === undefined ? 'main' : d[opts.group]
//instead of main would think a better default is opts.x
return opts.group === undefined ? opts.y : d[opts.group];
})
.entries(data);
}
if (opts.disabled != undefined){
data.map(function(d, i){
d.disabled = opts.disabled[i]
})
}
nv.addGraph(function() {
var chart = nv.models[opts.type]()
.width(opts.width)
.height(opts.height)
if (opts.type != "bulletChart"){
chart
.x(function(d) { return d[opts.x] })
.y(function(d) { return d[opts.y] })
}
chart
.tooltipContent( function(key, x, y, e ){
d3.selectAll('[class*=\"nv-path\"]').on('click',function(){
window.open(d3.select(this).datum().data['point'][4].link,'_blank');
})
var d = e.series.values[e.pointIndex];
return 'x: ' + x + ' y: ' + y + ' Headline: ' + d.name
} )
chart.xAxis
.axisLabel("Date")
chart.yAxis
.axisLabel("Share Price")
.width( 50)
d3.select("#" + opts.id)
.append('svg')
.datum(data)
.transition().duration(500)
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
};
</script>
<script></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment