Home > Sample Charts > VennDiagram > Combining Values and Labels

Combining Values and Labels

The Venn diagram shows a diagrammatic view of Set membership data, using the correct proportions for the simply case with 2 populations (and 1 overlap) and a simple diagram with intersecting circles for the 3-area case.

For a simple chart like this, it may be better to combine the text with the values and write everything into the circles. This has the advantage of saving space and allowing the chart to be drawn a little bigger.

Note that the Value-tag format patches in the X-labels, and then the entire string is wrapped using the X-label format.


SharpPlot sp = new SharpPlot;

data = new int[] {23,18,9};
sp.SetMargins(6,6,0,0);

sp.VennDiagramStyle = VennDiagramStyles.Filled|VennDiagramStyles.RedrawOutline|
         VennDiagramStyles.ValueTags;
sp.SetValueFont("arial",14,FontStyle.Bold,Color.White);
sp.ValueTagFormat = "XL #0";
sp.ValueLineSpacing = 100;
sp.SetColors(new Color[]{Color.Green,Color.Maroon});
sp.SetEdgeStyle(Color.Navy);
sp.SetXLabels(new string[]{"Female","Maths","Female and Maths"});
sp.XLabelFormat = "XXXXXXX;";

sp.DrawVennDiagram(data);

Worked Examples

venndiagram1 venndiagram2 venndiagram3 venndiagram4

Send comments on this topic
© Dyalog Ltd 2013