Example #1
0
        private float GetMaxHeight(PaneList paneList, Graphics g, float scaleFactor)
        {
            // Set up some scaled dimensions for calculating sizes and locations
            float defaultCharHeight = FontSpec.GetHeight(scaleFactor);
            float maxCharHeight     = defaultCharHeight;

            // Find the largest charHeight, just in case the curves have individual fonts defined
            foreach (GraphPane tmpPane in paneList)
            {
                foreach (CurveItem curve in tmpPane.CurveList)
                {
                    if (curve._label._text != string.Empty && curve._label._isVisible)
                    {
                        float tmpHeight = defaultCharHeight;
                        if (curve._label._fontSpec != null)
                        {
                            tmpHeight = curve._label._fontSpec.GetHeight(scaleFactor);
                        }

                        // Account for multiline legend entries
                        tmpHeight *= curve._label._text.Split('\n').Length;

                        if (tmpHeight > maxCharHeight)
                        {
                            maxCharHeight = tmpHeight;
                        }
                    }
                }
            }

            return(maxCharHeight);
        }