I was told about the Venn.js script on GitHub, which uses javascript to create Venn diagrams on an html page.
I have a basic script working, but I would like to add a sublabel in each set and intersection that shows its size
function LoadVenn() {
// size values are variables filled by an $.ajax() function.
// this is called in the $.ajax() success block.
var sets = [
{ sets: ['Less than Quarter'], size: ltq },
{ sets: ['Quarter'], size: qtr },
{ sets: ['Semester'], size: sem },
{ sets: ['Year'], size: year },
{ sets: ['Less than Quarter', 'Quarter'], size: ltqQtr },
{ sets: ['Less than Quarter', 'Semester'], size: ltqSem },
{ sets: ['Less than Quarter', 'Year'], size: ltqYear }
];
// the chart is accurately created.
var chart = venn.VennDiagram();
d3.select("#venn").datum(sets).call(chart);
// fill colors are good.
d3.selectAll("#venn .venn-circle path").style("fill-opacity", 0.8);
d3.selectAll("#venn text").style("fill", "white");
// need to make label text larger
// need to add sublabel showing set size
}
I did find a sublabel example here, but it was for an endlessly cycling animation chart (which I didn't want).
How can I add a sublabel to a static and non-animated chart?