London Lives Petitions in Sessions Papers, 1690-1799
// direct import instead of rdata =FileAttachment("data/llpp_pets_docs_year_exob_v1-2.tsv").tsv({typed:true})
Plot.plot({width: width,height:600,marginBottom:60,x: {tickRotate:90,tickFormat: d3.format('d')},y: { grid:true },color: {legend:true,//domain: ["male", "female"],//range: ["#b24747", "#47b2b2"] },marks: [ Plot.barY(data, {x:"year",y:"documents",fill:"dtype",order:"dtype",// i think this fixes the random problem.//offset: "normalize",tip:true,// need to format year againtip: {format: {x: (d) =>`${d}` } }//sort: {y: "x"} }),//Plot.ruleX([0]) ]})//"#b24747", "#d35400", 1), // orange//"#47b2b2", "#16a085", 1), // turquoise// problem that ptype were randomly ordered!// could fix it by uncounting the data in r and then using count in Plot. but dn't want that sort of faff// order: option seems to fix it.
Notes
The count of ‘other’ documents is likely to be slightly overestimated. Excludes OB.
Data: London Lives petitions project, v1.2
Dataviz: Observable Plot (supersedes earlier versions in dimple.js)