Exemplo n.º 1
0
        void FiveSetVennLabels(NVennSeries venn)
        {
            const int nCount = 5;

            string[] s1 = new string[] { "A", "B", "C", "D", "E" };
            string[] s2 = new string[] { "AC", "BD", "CE", "DA", "EB" };
            string[] s3 = new string[] { "ABCD", "BCDE", "CDEA", "DEAB", "EABC" };

            venn.ClearLabels();
            venn.LabelsTextStyle.FontStyle = new NFontStyle("Verdana", 8);

            // add the center label
            venn.AddLabel("ABCDE", new NPointF(0, 0));

            // add layer 1 labels, angle is in radians
            NPointF[] points = CalculateLabelPositions(nCount, 35, -1.1f);
            for (int i = 0; i < nCount; i++)
            {
                venn.AddLabel(s1[i], points[i]);
            }

            // add layer 2 labels, angle is in radians
            points = CalculateLabelPositions(nCount, 25, -1.3f);
            for (int i = 0; i < nCount; i++)
            {
                venn.AddLabel(s2[i], points[i]);
            }

            // add layer 4 labels, angle is in radians
            points = CalculateLabelPositions(nCount, 17.5f, -0.5f);
            for (int i = 0; i < nCount; i++)
            {
                venn.AddLabel(s3[i], points[i]);
            }
        }
        void ThreeSetVennLabels(NVennSeries venn)
        {
            string[] s1 = new string[] { "A", "B", "C" };
            string[] s2 = new string[] { "BC", "AC", "AB" };

            venn.ClearLabels();
            venn.LabelsTextStyle.FontStyle = new NFontStyle("Verdana", 8);

            // add the center label
            venn.AddLabel("ABC", new NPointF(0, 0));

            // add outer labels
            NPointF[] points = CalculateLabelPositions(3, 30, (float)(-Math.PI / 2));
            for (int i = 0; i < 3; i++)
            {
                venn.AddLabel(s1[i], points[i]);
            }

            // add middle labels
            points = CalculateLabelPositions(3, 17, (float)Math.PI / 2);
            for (int i = 0; i < 3; i++)
            {
                venn.AddLabel(s2[i], points[i]);
            }
        }
Exemplo n.º 3
0
        void TwoSetVennLabels(NVennSeries venn)
        {
            string[] s1 = new string[] { "A", "AB", "B" };

            venn.ClearLabels();
            venn.LabelsTextStyle.FontStyle = new NFontStyle("Verdana", 8);

            // add labels
            venn.AddLabel(s1[0], new NPointF(-25, 0));
            venn.AddLabel(s1[1], new NPointF(0, 0));
            venn.AddLabel(s1[2], new NPointF(25, 0));
        }
Exemplo n.º 4
0
        void FourSetVennLabels(NVennSeries venn)
        {
            string centreLabel = "ABCD";

            string[] s1 = new string[] { "A", "B", "C", "D" };
            string[] s2 = new string[] { "AC", "CD", "BD", "AD", "AB", "BC" };
            string[] s3 = new string[] { "ACD", "BCD", "ABD", "ABC" };

            venn.ClearLabels();
            venn.LabelsTextStyle.FontStyle = new NFontStyle("Verdana", 8);

            // add centre label
            venn.AddLabel(centreLabel, new NPointF(0, -8));

            // add layer 1 labels
            venn.AddLabel(s1[0], new NPointF(-12.5f - 15f, -10f + 10f));
            venn.AddLabel(s1[1], new NPointF(12.5f + 15f, -10f + 10f));
            venn.AddLabel(s1[2], new NPointF(-2.5f - 15f, 5f + 16f));
            venn.AddLabel(s1[3], new NPointF(2.5f + 15f, 5f + 16f));

            // add layer 2 labels
            venn.AddLabel(s2[0], new NPointF(-12.5f - 9f, -10f + 19f));
            venn.AddLabel(s2[1], new NPointF(0, -10f + 24f));
            venn.AddLabel(s2[2], new NPointF(12.5f + 9f, -10f + 19f));
            venn.AddLabel(s2[3], new NPointF(2.5f - 18f, 5f - 18f));
            venn.AddLabel(s2[4], new NPointF(0, -10f - 16f));
            venn.AddLabel(s2[5], new NPointF(-2.5f + 18f, 5f - 18f));

            // add layer 3 labels
            venn.AddLabel(s3[0], new NPointF(-12.5f + 1f, -10f + 10f));
            venn.AddLabel(s3[1], new NPointF(12.5f - 1f, -10f + 10f));
            venn.AddLabel(s3[2], new NPointF(2.5f - 10f, 5f - 21.5f));
            venn.AddLabel(s3[3], new NPointF(-2.5f + 10f, 5f - 21.5f));
        }