Skip to content

Instantly share code, notes, and snippets.

@englishm
Forked from anonymous/_.md
Created November 30, 2012 08:05
Show Gist options
  • Save englishm/4174438 to your computer and use it in GitHub Desktop.
Save englishm/4174438 to your computer and use it in GitHub Desktop.
Step Chart Demo
{"description":"Step Chart Demo","endpoint":"","display":"svg","public":true,"require":[],"tab":"edit","display_percent":0.7,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01}
var margin = {top: 20, right: 20, bottom: 30, left: 50},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
var x = d3.time.scale()
.range([0, width]);
var y = d3.scale.linear()
.range([height, 0]);
var xAxis = d3.svg.axis()
.scale(x)
.orient("bottom");
var yAxis = d3.svg.axis()
.scale(y)
.orient("left");
var line = d3.svg.line()
.x(function(d) { return x(d.date); })
.y(function(d) { return y(d.close); })
.interpolate("step-after");
var svg = d3.select("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
var data = [{"itemid":"25540","clock":"1354050342","value":"0","ns":"354125162"},{"itemid":"25540","clock":"1354050549","value":"1","ns":"833123891"},{"itemid":"25540","clock":"1354050751","value":"0","ns":"293377496"},{"itemid":"25540","clock":"1354050932","value":"1","ns":"286554481"},{"itemid":"25540","clock":"1354051257","value":"0","ns":"351335487"},{"itemid":"25540","clock":"1354051335","value":"1","ns":"205675900"},{"itemid":"25540","clock":"1354051506","value":"0","ns":"567430141"},{"itemid":"25540","clock":"1354051567","value":"1","ns":"166687749"},{"itemid":"25540","clock":"1354051611","value":"0","ns":"712844317"},{"itemid":"25540","clock":"1354051695","value":"1","ns":"587720770"},{"itemid":"25540","clock":"1354053637","value":"0","ns":"167622882"},{"itemid":"25540","clock":"1354053758","value":"1","ns":"743643935"},{"itemid":"25540","clock":"1354053792","value":"0","ns":"855597780"},{"itemid":"25540","clock":"1354053870","value":"1","ns":"711373971"},{"itemid":"25540","clock":"1354054005","value":"0","ns":"151995588"},{"itemid":"25540","clock":"1354054037","value":"1","ns":"658206925"},{"itemid":"25540","clock":"1354054117","value":"0","ns":"920950025"},{"itemid":"25540","clock":"1354054223","value":"1","ns":"868266652"},{"itemid":"25540","clock":"1354054306","value":"0","ns":"940406474"},{"itemid":"25540","clock":"1354054597","value":"1","ns":"894343303"},{"itemid":"25540","clock":"1354054686","value":"0","ns":"985111238"},{"itemid":"25540","clock":"1354054741","value":"1","ns":"965974330"},{"itemid":"25540","clock":"1354054885","value":"0","ns":"669220111"},{"itemid":"25540","clock":"1354054961","value":"1","ns":"83948355"},{"itemid":"25540","clock":"1354055603","value":"0","ns":"184508315"},{"itemid":"25540","clock":"1354055658","value":"1","ns":"565580502"},{"itemid":"25540","clock":"1354057290","value":"0","ns":"707617699"},{"itemid":"25540","clock":"1354057396","value":"1","ns":"251254525"},{"itemid":"25540","clock":"1354058251","value":"0","ns":"36036804"},{"itemid":"25540","clock":"1354058326","value":"1","ns":"482855839"},{"itemid":"25540","clock":"1354110150","value":"0","ns":"901071880"},{"itemid":"25540","clock":"1354110351","value":"1","ns":"860931765"},{"itemid":"25540","clock":"1354111649","value":"0","ns":"351960561"},{"itemid":"25540","clock":"1354111785","value":"1","ns":"751274655"},{"itemid":"25540","clock":"1354112623","value":"0","ns":"693494698"},{"itemid":"25540","clock":"1354112757","value":"1","ns":"732031430"},{"itemid":"25540","clock":"1354113216","value":"0","ns":"832676224"},{"itemid":"25540","clock":"1354113296","value":"1","ns":"692511986"},{"itemid":"25540","clock":"1354114076","value":"0","ns":"39892843"},{"itemid":"25540","clock":"1354114140","value":"1","ns":"250203965"},{"itemid":"25540","clock":"1354114248","value":"0","ns":"203439108"},{"itemid":"25540","clock":"1354114336","value":"1","ns":"91408501"},{"itemid":"25540","clock":"1354115017","value":"0","ns":"923075089"},{"itemid":"25540","clock":"1354115155","value":"1","ns":"172162323"},{"itemid":"25540","clock":"1354115787","value":"0","ns":"642623224"},{"itemid":"25540","clock":"1354115870","value":"1","ns":"713381941"},{"itemid":"25540","clock":"1354116487","value":"0","ns":"532577923"},{"itemid":"25540","clock":"1354116591","value":"1","ns":"471607224"},{"itemid":"25540","clock":"1354116662","value":"0","ns":"504779134"},{"itemid":"25540","clock":"1354116737","value":"1","ns":"148071893"},{"itemid":"25540","clock":"1354116965","value":"0","ns":"496740457"},{"itemid":"25540","clock":"1354117032","value":"1","ns":"515713508"},{"itemid":"25540","clock":"1354118004","value":"0","ns":"903383734"},{"itemid":"25540","clock":"1354118054","value":"1","ns":"665379601"},{"itemid":"25540","clock":"1354118354","value":"0","ns":"45836301"},{"itemid":"25540","clock":"1354118398","value":"1","ns":"590656452"},{"itemid":"25540","clock":"1354118680","value":"0","ns":"763567142"},{"itemid":"25540","clock":"1354118725","value":"1","ns":"662087310"},{"itemid":"25540","clock":"1354118777","value":"0","ns":"832228843"},{"itemid":"25540","clock":"1354119092","value":"1","ns":"62489123"},{"itemid":"25540","clock":"1354119315","value":"0","ns":"192544034"},{"itemid":"25540","clock":"1354119625","value":"1","ns":"819328767"},{"itemid":"25540","clock":"1354120300","value":"0","ns":"415671217"},{"itemid":"25540","clock":"1354120366","value":"1","ns":"234027097"},{"itemid":"25540","clock":"1354120385","value":"0","ns":"894280224"},{"itemid":"25540","clock":"1354120452","value":"1","ns":"913895384"},{"itemid":"25540","clock":"1354120476","value":"0","ns":"590816180"},{"itemid":"25540","clock":"1354120564","value":"1","ns":"878655127"},{"itemid":"25540","clock":"1354121002","value":"0","ns":"941693044"},{"itemid":"25540","clock":"1354121019","value":"1","ns":"164240338"},{"itemid":"25540","clock":"1354121684","value":"0","ns":"137465670"},{"itemid":"25540","clock":"1354121742","value":"1","ns":"729239075"},{"itemid":"25540","clock":"1354122939","value":"0","ns":"447985679"},{"itemid":"25540","clock":"1354123034","value":"1","ns":"960809803"},{"itemid":"25540","clock":"1354123191","value":"0","ns":"71437817"},{"itemid":"25540","clock":"1354123256","value":"1","ns":"886528570"},{"itemid":"25540","clock":"1354123825","value":"0","ns":"949801670"},{"itemid":"25540","clock":"1354123986","value":"1","ns":"475406902"},{"itemid":"25540","clock":"1354125111","value":"0","ns":"756349513"},{"itemid":"25540","clock":"1354125171","value":"1","ns":"952988445"},{"itemid":"25540","clock":"1354125834","value":"0","ns":"521317410"},{"itemid":"25540","clock":"1354125945","value":"1","ns":"282586105"},{"itemid":"25540","clock":"1354126100","value":"0","ns":"190004973"},{"itemid":"25540","clock":"1354126225","value":"1","ns":"801363531"},{"itemid":"25540","clock":"1354126414","value":"0","ns":"16800055"},{"itemid":"25540","clock":"1354126481","value":"1","ns":"838138028"},{"itemid":"25540","clock":"1354126490","value":"0","ns":"266619539"},{"itemid":"25540","clock":"1354126621","value":"1","ns":"495431144"},{"itemid":"25540","clock":"1354126751","value":"0","ns":"922789135"},{"itemid":"25540","clock":"1354126785","value":"1","ns":"232608252"},{"itemid":"25540","clock":"1354126895","value":"0","ns":"995090894"},{"itemid":"25540","clock":"1354127080","value":"1","ns":"599836483"},{"itemid":"25540","clock":"1354127114","value":"0","ns":"309181521"},{"itemid":"25540","clock":"1354127149","value":"1","ns":"223488845"},{"itemid":"25540","clock":"1354128454","value":"0","ns":"295968565"},{"itemid":"25540","clock":"1354128540","value":"1","ns":"979484634"},{"itemid":"25540","clock":"1354128664","value":"0","ns":"182452698"},{"itemid":"25540","clock":"1354128719","value":"1","ns":"563432476"},{"itemid":"25540","clock":"1354128734","value":"0","ns":"10581726"},{"itemid":"25540","clock":"1354128882","value":"1","ns":"897337365"},{"itemid":"25540","clock":"1354128951","value":"0","ns":"923659843"},{"itemid":"25540","clock":"1354129025","value":"1","ns":"765606004"},{"itemid":"25540","clock":"1354129080","value":"0","ns":"343604514"},{"itemid":"25540","clock":"1354129210","value":"1","ns":"369820205"},{"itemid":"25540","clock":"1354129219","value":"0","ns":"198996741"},{"itemid":"25540","clock":"1354129266","value":"1","ns":"955363694"},{"itemid":"25540","clock":"1354129405","value":"0","ns":"462206075"},{"itemid":"25540","clock":"1354129474","value":"1","ns":"435317881"},{"itemid":"25540","clock":"1354130643","value":"0","ns":"463092686"},{"itemid":"25540","clock":"1354130730","value":"1","ns":"548158360"},{"itemid":"25540","clock":"1354131571","value":"0","ns":"699418533"},{"itemid":"25540","clock":"1354131652","value":"1","ns":"763864837"},{"itemid":"25540","clock":"1354131853","value":"0","ns":"422508974"},{"itemid":"25540","clock":"1354131952","value":"1","ns":"547588194"},{"itemid":"25540","clock":"1354132281","value":"0","ns":"626275627"},{"itemid":"25540","clock":"1354132376","value":"1","ns":"334760707"},{"itemid":"25540","clock":"1354132846","value":"0","ns":"675450245"},{"itemid":"25540","clock":"1354133154","value":"1","ns":"884944614"},{"itemid":"25540","clock":"1354133305","value":"0","ns":"808466965"},{"itemid":"25540","clock":"1354133457","value":"1","ns":"476507066"},{"itemid":"25540","clock":"1354133528","value":"0","ns":"509222826"},{"itemid":"25540","clock":"1354133567","value":"1","ns":"837649142"},{"itemid":"25540","clock":"1354133581","value":"0","ns":"884092317"},{"itemid":"25540","clock":"1354133658","value":"1","ns":"133349367"},{"itemid":"25540","clock":"1354133812","value":"0","ns":"638884957"},{"itemid":"25540","clock":"1354133864","value":"1","ns":"408182165"},{"itemid":"25540","clock":"1354133942","value":"0","ns":"262863018"},{"itemid":"25540","clock":"1354134008","value":"1","ns":"108046350"},{"itemid":"25540","clock":"1354134518","value":"0","ns":"546061231"},{"itemid":"25540","clock":"1354134683","value":"1","ns":"486889418"},{"itemid":"25540","clock":"1354136470","value":"0","ns":"973231794"},{"itemid":"25540","clock":"1354136872","value":"1","ns":"662228160"},{"itemid":"25540","clock":"1354136953","value":"0","ns":"325704148"},{"itemid":"25540","clock":"1354137297","value":"1","ns":"251772427"},{"itemid":"25540","clock":"1354138014","value":"0","ns":"802279025"},{"itemid":"25540","clock":"1354138101","value":"1","ns":"84494742"},{"itemid":"25540","clock":"1354138489","value":"0","ns":"959476497"},{"itemid":"25540","clock":"1354138573","value":"1","ns":"833806568"},{"itemid":"25540","clock":"1354138607","value":"0","ns":"544372250"},{"itemid":"25540","clock":"1354138688","value":"1","ns":"610155722"},{"itemid":"25540","clock":"1354138809","value":"0","ns":"806224343"},{"itemid":"25540","clock":"1354138886","value":"1","ns":"56439119"},{"itemid":"25540","clock":"1354139033","value":"0","ns":"739518434"},{"itemid":"25540","clock":"1354139073","value":"1","ns":"870846805"},{"itemid":"25540","clock":"1354139244","value":"0","ns":"428910703"},{"itemid":"25540","clock":"1354139317","value":"1","ns":"66143424"},{"itemid":"25540","clock":"1354139456","value":"0","ns":"724724564"},{"itemid":"25540","clock":"1354139526","value":"1","ns":"954131621"},{"itemid":"25540","clock":"1354139726","value":"0","ns":"407271047"},{"itemid":"25540","clock":"1354139810","value":"1","ns":"282326984"},{"itemid":"25540","clock":"1354139825","value":"0","ns":"131240101"},{"itemid":"25540","clock":"1354139938","value":"1","ns":"703528769"},{"itemid":"25540","clock":"1354140225","value":"0","ns":"240765921"},{"itemid":"25540","clock":"1354140318","value":"1","ns":"346072633"},{"itemid":"25540","clock":"1354140739","value":"0","ns":"327129456"},{"itemid":"25540","clock":"1354140799","value":"1","ns":"122738303"},{"itemid":"25540","clock":"1354140813","value":"0","ns":"570124808"},{"itemid":"25540","clock":"1354140849","value":"1","ns":"688484594"},{"itemid":"25540","clock":"1354140857","value":"0","ns":"312776188"},{"itemid":"25540","clock":"1354140910","value":"1","ns":"286639384"},{"itemid":"25540","clock":"1354141110","value":"0","ns":"543876875"},{"itemid":"25540","clock":"1354141238","value":"1","ns":"162272554"},{"itemid":"25540","clock":"1354141796","value":"0","ns":"390821062"},{"itemid":"25540","clock":"1354141854","value":"1","ns":"180167555"},{"itemid":"25540","clock":"1354142967","value":"0","ns":"829275338"},{"itemid":"25540","clock":"1354143110","value":"1","ns":"309063565"},{"itemid":"25540","clock":"1354196318","value":"0","ns":"225110642"},{"itemid":"25540","clock":"1354196524","value":"1","ns":"711868706"},{"itemid":"25540","clock":"1354197111","value":"0","ns":"830607163"},{"itemid":"25540","clock":"1354197161","value":"1","ns":"193759538"},{"itemid":"25540","clock":"1354197866","value":"0","ns":"299265576"},{"itemid":"25540","clock":"1354197944","value":"1","ns":"554721110"},{"itemid":"25540","clock":"1354198112","value":"0","ns":"704769410"},{"itemid":"25540","clock":"1354198148","value":"1","ns":"421545963"},{"itemid":"25540","clock":"1354199618","value":"0","ns":"831610684"},{"itemid":"25540","clock":"1354199751","value":"1","ns":"265342617"},{"itemid":"25540","clock":"1354200002","value":"0","ns":"887979362"},{"itemid":"25540","clock":"1354200063","value":"1","ns":"887782790"},{"itemid":"25540","clock":"1354200205","value":"0","ns":"550958588"},{"itemid":"25540","clock":"1354200263","value":"1","ns":"341176694"},{"itemid":"25540","clock":"1354200273","value":"0","ns":"775094804"},{"itemid":"25540","clock":"1354200337","value":"1","ns":"182514277"},{"itemid":"25540","clock":"1354201328","value":"0","ns":"31768792"},{"itemid":"25540","clock":"1354201532","value":"1","ns":"301352427"},{"itemid":"25540","clock":"1354201544","value":"0","ns":"741542425"},{"itemid":"25540","clock":"1354201587","value":"1","ns":"281041230"},{"itemid":"25540","clock":"1354201663","value":"0","ns":"531764765"},{"itemid":"25540","clock":"1354201836","value":"1","ns":"898372000"},{"itemid":"25540","clock":"1354201942","value":"0","ns":"881454758"},{"itemid":"25540","clock":"1354202205","value":"1","ns":"307060360"},{"itemid":"25540","clock":"1354202613","value":"0","ns":"844292654"},{"itemid":"25540","clock":"1354202684","value":"1","ns":"876488205"},{"itemid":"25540","clock":"1354202867","value":"0","ns":"877208383"},{"itemid":"25540","clock":"1354202913","value":"1","ns":"223947304"},{"itemid":"25540","clock":"1354203423","value":"0","ns":"693810718"},{"itemid":"25540","clock":"1354203515","value":"1","ns":"593975918"},{"itemid":"25540","clock":"1354203586","value":"0","ns":"720064008"},{"itemid":"25540","clock":"1354203715","value":"1","ns":"848378865"},{"itemid":"25540","clock":"1354203859","value":"0","ns":"920387268"},{"itemid":"25540","clock":"1354204108","value":"1","ns":"736576430"},{"itemid":"25540","clock":"1354204173","value":"0","ns":"749656168"},{"itemid":"25540","clock":"1354204208","value":"1","ns":"662973359"},{"itemid":"25540","clock":"1354204330","value":"0","ns":"664415321"},{"itemid":"25540","clock":"1354204378","value":"1","ns":"419965129"},{"itemid":"25540","clock":"1354204646","value":"0","ns":"96002958"},{"itemid":"25540","clock":"1354204751","value":"1","ns":"240378625"},{"itemid":"25540","clock":"1354205316","value":"0","ns":"690238489"},{"itemid":"25540","clock":"1354205390","value":"1","ns":"139562442"},{"itemid":"25540","clock":"1354205941","value":"0","ns":"534367678"},{"itemid":"25540","clock":"1354205986","value":"1","ns":"80910094"},{"itemid":"25540","clock":"1354206290","value":"0","ns":"279515245"},{"itemid":"25540","clock":"1354206364","value":"1","ns":"925630383"},{"itemid":"25540","clock":"1354206468","value":"0","ns":"866311651"},{"itemid":"25540","clock":"1354206516","value":"1","ns":"228065218"},{"itemid":"25540","clock":"1354206533","value":"0","ns":"77282569"},{"itemid":"25540","clock":"1354206593","value":"1","ns":"275508398"},{"itemid":"25540","clock":"1354206610","value":"0","ns":"130173827"},{"itemid":"25540","clock":"1354206685","value":"1","ns":"176663914"},{"itemid":"25540","clock":"1354207033","value":"0","ns":"115713356"},{"itemid":"25540","clock":"1354207222","value":"1","ns":"134518857"},{"itemid":"25540","clock":"1354207389","value":"0","ns":"80355354"},{"itemid":"25540","clock":"1354207463","value":"1","ns":"724351588"},{"itemid":"25540","clock":"1354207566","value":"0","ns":"861116626"},{"itemid":"25540","clock":"1354207604","value":"1","ns":"584777134"},{"itemid":"25540","clock":"1354207903","value":"0","ns":"964601500"},{"itemid":"25540","clock":"1354207964","value":"1","ns":"563259997"},{"itemid":"25540","clock":"1354208123","value":"0","ns":"483756792"},{"itemid":"25540","clock":"1354208202","value":"1","ns":"542245874"},{"itemid":"25540","clock":"1354208214","value":"0","ns":"336386181"},{"itemid":"25540","clock":"1354208306","value":"1","ns":"483575782"},{"itemid":"25540","clock":"1354208739","value":"0","ns":"502481801"},{"itemid":"25540","clock":"1354208794","value":"1","ns":"147326246"},{"itemid":"25540","clock":"1354210677","value":"0","ns":"47832854"},{"itemid":"25540","clock":"1354210798","value":"1","ns":"243847327"},{"itemid":"25540","clock":"1354211122","value":"0","ns":"501330256"},{"itemid":"25540","clock":"1354211339","value":"1","ns":"215367620"},{"itemid":"25540","clock":"1354211427","value":"0","ns":"104301668"},{"itemid":"25540","clock":"1354211468","value":"1","ns":"840850939"},{"itemid":"25540","clock":"1354211486","value":"0","ns":"98034412"},{"itemid":"25540","clock":"1354211583","value":"1","ns":"659471183"},{"itemid":"25540","clock":"1354211712","value":"0","ns":"842563437"},{"itemid":"25540","clock":"1354211928","value":"1","ns":"749423200"},{"itemid":"25540","clock":"1354212002","value":"0","ns":"992493502"},{"itemid":"25540","clock":"1354212042","value":"1","ns":"723673903"},{"itemid":"25540","clock":"1354212137","value":"0","ns":"32078120"},{"itemid":"25540","clock":"1354212197","value":"1","ns":"630878300"},{"itemid":"25540","clock":"1354213514","value":"0","ns":"343542195"},{"itemid":"25540","clock":"1354213605","value":"1","ns":"857028247"},{"itemid":"25540","clock":"1354213871","value":"0","ns":"915148402"},{"itemid":"25540","clock":"1354213967","value":"1","ns":"828933713"},{"itemid":"25540","clock":"1354214495","value":"0","ns":"148166687"},{"itemid":"25540","clock":"1354214573","value":"1","ns":"4849867"},{"itemid":"25540","clock":"1354214597","value":"0","ns":"84165347"},{"itemid":"25540","clock":"1354214686","value":"1","ns":"177529722"},{"itemid":"25540","clock":"1354215169","value":"0","ns":"767456474"},{"itemid":"25540","clock":"1354215302","value":"1","ns":"603604917"},{"itemid":"25540","clock":"1354215939","value":"0","ns":"90169994"},{"itemid":"25540","clock":"1354215991","value":"1","ns":"261342475"},{"itemid":"25540","clock":"1354216266","value":"0","ns":"964919857"},{"itemid":"25540","clock":"1354216615","value":"1","ns":"304856254"},{"itemid":"25540","clock":"1354216880","value":"0","ns":"233823460"},{"itemid":"25540","clock":"1354216987","value":"1","ns":"726875051"},{"itemid":"25540","clock":"1354217710","value":"0","ns":"496276916"},{"itemid":"25540","clock":"1354217785","value":"1","ns":"140525753"},{"itemid":"25540","clock":"1354218645","value":"0","ns":"165464208"},{"itemid":"25540","clock":"1354218750","value":"1","ns":"707274668"},{"itemid":"25540","clock":"1354218772","value":"0","ns":"779905000"},{"itemid":"25540","clock":"1354218824","value":"1","ns":"950692771"},{"itemid":"25540","clock":"1354218861","value":"0","ns":"471166264"},{"itemid":"25540","clock":"1354218919","value":"1","ns":"261030333"},{"itemid":"25540","clock":"1354218927","value":"0","ns":"286976812"},{"itemid":"25540","clock":"1354218968","value":"1","ns":"221624481"},{"itemid":"25540","clock":"1354218985","value":"0","ns":"76983666"},{"itemid":"25540","clock":"1354219171","value":"1","ns":"289814181"},{"itemid":"25540","clock":"1354219255","value":"0","ns":"967152040"},{"itemid":"25540","clock":"1354219413","value":"1","ns":"386688652"},{"itemid":"25540","clock":"1354220341","value":"0","ns":"530530044"},{"itemid":"25540","clock":"1354220389","value":"1","ns":"726220724"},{"itemid":"25540","clock":"1354221030","value":"0","ns":"593873254"},{"itemid":"25540","clock":"1354221091","value":"1","ns":"995445530"},{"itemid":"25540","clock":"1354222034","value":"0","ns":"690008695"},{"itemid":"25540","clock":"1354222079","value":"1","ns":"636814827"},{"itemid":"25540","clock":"1354222095","value":"0","ns":"288653166"},{"itemid":"25540","clock":"1354222178","value":"1","ns":"361273108"},{"itemid":"25540","clock":"1354222194","value":"0","ns":"413244955"},{"itemid":"25540","clock":"1354222231","value":"1","ns":"754825948"},{"itemid":"25540","clock":"1354222248","value":"0","ns":"591386826"},{"itemid":"25540","clock":"1354222343","value":"1","ns":"303428666"},{"itemid":"25540","clock":"1354223103","value":"0","ns":"801049319"},{"itemid":"25540","clock":"1354223200","value":"1","ns":"919643745"},{"itemid":"25540","clock":"1354223266","value":"0","ns":"744747027"},{"itemid":"25540","clock":"1354223369","value":"1","ns":"875056071"},{"itemid":"25540","clock":"1354223479","value":"0","ns":"34398399"},{"itemid":"25540","clock":"1354223530","value":"1","ns":"803573800"},{"itemid":"25540","clock":"1354223576","value":"0","ns":"152929804"},{"itemid":"25540","clock":"1354223635","value":"1","ns":"146925400"},{"itemid":"25540","clock":"1354225083","value":"0","ns":"99233871"},{"itemid":"25540","clock":"1354225190","value":"1","ns":"724017182"},{"itemid":"25540","clock":"1354225246","value":"0","ns":"835835967"},{"itemid":"25540","clock":"1354225395","value":"1","ns":"723131021"},{"itemid":"25540","clock":"1354225566","value":"0","ns":"279458822"},{"itemid":"25540","clock":"1354225656","value":"1","ns":"975654615"},{"itemid":"25540","clock":"1354226576","value":"0","ns":"398026751"},{"itemid":"25540","clock":"1354226579","value":"1","ns":"207356148"},{"itemid":"25540","clock":"1354226591","value":"0","ns":"648725252"},{"itemid":"25540","clock":"1354226642","value":"1","ns":"213905155"},{"itemid":"25540","clock":"1354227527","value":"0","ns":"528209677"},{"itemid":"25540","clock":"1354227593","value":"1","ns":"339697284"},{"itemid":"25540","clock":"1354228065","value":"0","ns":"692457689"},{"itemid":"25540","clock":"1354228126","value":"1","ns":"291837033"},{"itemid":"25540","clock":"1354246153","value":"0","ns":"424125415"},{"itemid":"25540","clock":"1354246275","value":"1","ns":"424127038"},{"itemid":"25540","clock":"1354282379","value":"0","ns":"173682997"},{"itemid":"25540","clock":"1354282414","value":"1","ns":"276226365"},{"itemid":"25540","clock":"1354282603","value":"0","ns":"302176759"},{"itemid":"25540","clock":"1354282731","value":"1","ns":"707863149"},{"itemid":"25540","clock":"1354283205","value":"0","ns":"664002435"},{"itemid":"25540","clock":"1354283317","value":"1","ns":"656934787"},{"itemid":"25540","clock":"1354283846","value":"0","ns":"183874334"},{"itemid":"25540","clock":"1354283874","value":"1","ns":"277606362"},{"itemid":"25540","clock":"1354283885","value":"0","ns":"497368938"},{"itemid":"25540","clock":"1354283927","value":"1","ns":"635447531"},{"itemid":"25540","clock":"1354284217","value":"0","ns":"105573857"},{"itemid":"25540","clock":"1354284276","value":"1","ns":"376843143"},{"itemid":"25540","clock":"1354284686","value":"0","ns":"117522623"},{"itemid":"25540","clock":"1354284809","value":"1","ns":"322344686"},{"itemid":"25540","clock":"1354284866","value":"0","ns":"726661882"},{"itemid":"25540","clock":"1354284920","value":"1","ns":"87057589"},{"itemid":"25540","clock":"1354285045","value":"0","ns":"700127839"},{"itemid":"25540","clock":"1354285141","value":"1","ns":"214013823"},{"itemid":"25540","clock":"1354285387","value":"0","ns":"226544648"},{"itemid":"25540","clock":"1354285437","value":"1","ns":"785285083"},{"itemid":"25540","clock":"1354285539","value":"0","ns":"451989629"},{"itemid":"25540","clock":"1354285843","value":"1","ns":"126172110"},{"itemid":"25540","clock":"1354286536","value":"0","ns":"206578069"},{"itemid":"25540","clock":"1354286579","value":"1","ns":"119091488"},{"itemid":"25540","clock":"1354286957","value":"0","ns":"960115186"},{"itemid":"25540","clock":"1354287010","value":"1","ns":"531662738"},{"itemid":"25540","clock":"1354287449","value":"0","ns":"972539601"},{"itemid":"25540","clock":"1354287519","value":"1","ns":"801101381"},{"itemid":"25540","clock":"1354288025","value":"0","ns":"478076335"},{"itemid":"25540","clock":"1354288077","value":"1","ns":"227004093"},{"itemid":"25540","clock":"1354288111","value":"0","ns":"739811396"},{"itemid":"25540","clock":"1354288150","value":"1","ns":"265992517"},{"itemid":"25540","clock":"1354288294","value":"0","ns":"739546209"},{"itemid":"25540","clock":"1354288339","value":"1","ns":"687229448"},{"itemid":"25540","clock":"1354288358","value":"0","ns":"950242649"},{"itemid":"25540","clock":"1354288726","value":"1","ns":"957772292"},{"itemid":"25540","clock":"1354288736","value":"0","ns":"989677009"},{"itemid":"25540","clock":"1354289080","value":"1","ns":"918284509"},{"itemid":"25540","clock":"1354289114","value":"0","ns":"628900716"},{"itemid":"25540","clock":"1354289160","value":"1","ns":"781227283"},{"itemid":"25540","clock":"1354289600","value":"0","ns":"622034703"},{"itemid":"25540","clock":"1354289663","value":"1","ns":"627551367"},{"itemid":"25540","clock":"1354289678","value":"0","ns":"476484168"},{"itemid":"25540","clock":"1354289756","value":"1","ns":"732679241"},{"itemid":"25540","clock":"1354289839","value":"0","ns":"17074344"},{"itemid":"25540","clock":"1354289894","value":"1","ns":"383455390"},{"itemid":"25540","clock":"1354290207","value":"0","ns":"408792004"},{"itemid":"25540","clock":"1354290264","value":"1","ns":"796416965"},{"itemid":"25540","clock":"1354290279","value":"0","ns":"645366835"},{"itemid":"25540","clock":"1354290331","value":"1","ns":"815774364"},{"itemid":"25540","clock":"1354290392","value":"0","ns":"414455611"},{"itemid":"25540","clock":"1354290519","value":"1","ns":"630829019"},{"itemid":"25540","clock":"1354290557","value":"0","ns":"756329946"},{"itemid":"25540","clock":"1354290627","value":"1","ns":"985680184"},{"itemid":"25540","clock":"1354290659","value":"0","ns":"690681915"},{"itemid":"25540","clock":"1354290727","value":"1","ns":"913025245"},{"itemid":"25540","clock":"1354290789","value":"0","ns":"318833662"},{"itemid":"25540","clock":"1354290853","value":"1","ns":"132243371"},{"itemid":"25540","clock":"1354291119","value":"0","ns":"195575776"},{"itemid":"25540","clock":"1354291317","value":"1","ns":"44405537"},{"itemid":"25540","clock":"1354291344","value":"0","ns":"734850654"},{"itemid":"25540","clock":"1354291395","value":"1","ns":"702425936"},{"itemid":"25540","clock":"1354291441","value":"0","ns":"452966448"},{"itemid":"25540","clock":"1354291493","value":"1","ns":"622748885"},{"itemid":"25540","clock":"1354291512","value":"0","ns":"886029444"},{"itemid":"25540","clock":"1354291632","value":"1","ns":"478619657"},{"itemid":"25540","clock":"1354291945","value":"0","ns":"905110609"},{"itemid":"25540","clock":"1354291995","value":"1","ns":"669091208"},{"itemid":"25540","clock":"1354292406","value":"0","ns":"614622828"},{"itemid":"25540","clock":"1354292543","value":"1","ns":"463498907"},{"itemid":"25540","clock":"1354292881","value":"0","ns":"771660319"},{"itemid":"25540","clock":"1354292941","value":"1","ns":"568166018"},{"itemid":"25540","clock":"1354293354","value":"0","ns":"922048235"},{"itemid":"25540","clock":"1354293392","value":"1","ns":"645717324"},{"itemid":"25540","clock":"1354294483","value":"0","ns":"513062524"},{"itemid":"25540","clock":"1354294550","value":"1","ns":"41970493"},{"itemid":"25540","clock":"1354294885","value":"0","ns":"540133361"},{"itemid":"25540","clock":"1354294936","value":"1","ns":"907195039"},{"itemid":"25540","clock":"1354294998","value":"0","ns":"308323266"},{"itemid":"25540","clock":"1354295224","value":"1","ns":"648561035"},{"itemid":"25540","clock":"1354295235","value":"0","ns":"83256731"},{"itemid":"25540","clock":"1354295317","value":"1","ns":"758517225"},{"itemid":"25540","clock":"1354295410","value":"0","ns":"55821599"},{"itemid":"25540","clock":"1354295516","value":"1","ns":"806576937"},{"itemid":"25540","clock":"1354295698","value":"0","ns":"200099732"},{"itemid":"25540","clock":"1354295813","value":"1","ns":"778136786"},{"itemid":"25540","clock":"1354295902","value":"0","ns":"869735622"},{"itemid":"25540","clock":"1354295962","value":"1","ns":"666241646"},{"itemid":"25540","clock":"1354296358","value":"0","ns":"124672936"},{"itemid":"25540","clock":"1354296449","value":"1","ns":"57263054"},{"itemid":"25540","clock":"1354296666","value":"0","ns":"971977762"},{"itemid":"25540","clock":"1354296797","value":"1","ns":"398948009"},{"itemid":"25540","clock":"1354296935","value":"0","ns":"95676722"},{"itemid":"25540","clock":"1354296981","value":"1","ns":"603049148"},{"itemid":"25540","clock":"1354297156","value":"0","ns":"977446827"},{"itemid":"25540","clock":"1354297252","value":"1","ns":"490625532"},{"itemid":"25540","clock":"1354297373","value":"0","ns":"687452074"},{"itemid":"25540","clock":"1354297441","value":"1","ns":"112066301"},{"itemid":"25540","clock":"1354297887","value":"0","ns":"370346354"},{"itemid":"25540","clock":"1354297996","value":"1","ns":"528791102"},{"itemid":"25540","clock":"1354298439","value":"0","ns":"981236541"},{"itemid":"25540","clock":"1354298507","value":"1","ns":"401984241"},{"itemid":"25540","clock":"1354298667","value":"0","ns":"928423895"},{"itemid":"25540","clock":"1354298723","value":"1","ns":"711185615"},{"itemid":"25540","clock":"1354298891","value":"0","ns":"59519170"},{"itemid":"25540","clock":"1354299057","value":"1","ns":"605805629"},{"itemid":"25540","clock":"1354299220","value":"0","ns":"940796166"},{"itemid":"25540","clock":"1354299358","value":"1","ns":"992926852"},{"itemid":"25540","clock":"1354299464","value":"0","ns":"538637885"},{"itemid":"25540","clock":"1354299511","value":"1","ns":"271573965"},{"itemid":"25540","clock":"1354299601","value":"0","ns":"11708699"},{"itemid":"25540","clock":"1354299734","value":"1","ns":"624157429"},{"itemid":"25540","clock":"1354300140","value":"0","ns":"354750541"},{"itemid":"25540","clock":"1354300200","value":"1","ns":"952258322"},{"itemid":"25540","clock":"1354300946","value":"0","ns":"702029963"},{"itemid":"25540","clock":"1354301070","value":"1","ns":"199388136"},{"itemid":"25540","clock":"1354301148","value":"0","ns":"456643367"},{"itemid":"25540","clock":"1354301202","value":"1","ns":"232598316"},{"itemid":"25540","clock":"1354301263","value":"0","ns":"232588739"},{"itemid":"25540","clock":"1354301302","value":"1","ns":"963640878"},{"itemid":"25540","clock":"1354301390","value":"0","ns":"450215391"},{"itemid":"25540","clock":"1354301545","value":"1","ns":"759995152"},{"itemid":"25540","clock":"1354301949","value":"0","ns":"79503611"},{"itemid":"25540","clock":"1354302010","value":"1","ns":"480816487"},{"itemid":"25540","clock":"1354302246","value":"0","ns":"452990996"},{"itemid":"25540","clock":"1354302316","value":"1","ns":"681945282"},{"itemid":"25540","clock":"1354302530","value":"0","ns":"984451225"},{"itemid":"25540","clock":"1354302685","value":"1","ns":"489837977"},{"itemid":"25540","clock":"1354302721","value":"0","ns":"206256943"},{"itemid":"25540","clock":"1354302760","value":"1","ns":"134162247"},{"itemid":"25540","clock":"1354302929","value":"0","ns":"87916592"},{"itemid":"25540","clock":"1354302959","value":"1","ns":"588346222"},{"itemid":"25540","clock":"1354303783","value":"0","ns":"890665756"},{"itemid":"25540","clock":"1354303865","value":"1","ns":"357166931"},{"itemid":"25540","clock":"1354303969","value":"0","ns":"699913138"},{"itemid":"25540","clock":"1354304301","value":"1","ns":"988554145"},{"itemid":"25540","clock":"1354304842","value":"0","ns":"158174064"},{"itemid":"25540","clock":"1354304921","value":"1","ns":"216800413"},{"itemid":"25540","clock":"1354305807","value":"0","ns":"322313219"},{"itemid":"25540","clock":"1354305974","value":"1","ns":"669237537"},{"itemid":"25540","clock":"1354306156","value":"0","ns":"636111406"},{"itemid":"25540","clock":"1354306248","value":"1","ns":"764191679"},{"itemid":"25540","clock":"1354307397","value":"0","ns":"310749598"},{"itemid":"25540","clock":"1354307490","value":"1","ns":"14640912"},{"itemid":"25540","clock":"1354308274","value":"0","ns":"184612697"},{"itemid":"25540","clock":"1354308472","value":"1","ns":"436805036"},{"itemid":"25540","clock":"1354308750","value":"0","ns":"549600328"},{"itemid":"25540","clock":"1354308823","value":"1","ns":"187388549"},{"itemid":"25540","clock":"1354308854","value":"0","ns":"89046554"},{"itemid":"25540","clock":"1354308930","value":"1","ns":"741977621"},{"itemid":"25540","clock":"1354309392","value":"0","ns":"257749736"},{"itemid":"25540","clock":"1354309477","value":"1","ns":"336571562"}]
data.forEach(function(d){
// console.log("d.clock: " + d.clock);
// console.log("d.value: " + d.value);
d.date = new Date(d.clock * 1000);
d.close = d.value;
// console.log("d.date: " + d.date);
// console.log("d.close: " + d.close);
});
x.domain(d3.extent(data, function(d) { return d.date; }));
y.domain(d3.extent(data, function(d) { return d.close; }));
svg.append("g")
.attr("class", "x axis")
.attr("transform", "translate(0," + height + ")")
.call(xAxis);
svg.append("g")
.attr("class", "y axis")
.call(yAxis)
.append("text")
.attr("transform", "rotate(-90)")
.attr("y", 5)
.attr("dy", ".71em")
.style("text-anchor", "end")
.text("Value");
svg.append("path")
.datum(data)
.attr("class", "line")
.attr("d", line)
.attr("fill","none")
.attr("stroke","steelblue")
.attr("stroke-width","3px");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment