Exemple #1
0
        private void parseXGrid(String xgrid)
        {
            if (xgrid == null)
            {
                return;
            }

            if (xgrid.ToLower().CompareTo("none") == 0)
            {
                gdef.setDrawXGrid(false);
                return;
            }
            String[] tokens = xgrid.Split(':');
            if (tokens.Length != 8)
            {
                throw new ArgumentException("Invalid XGRID settings: " + xgrid);
            }

            int minorUnit = resolveUnit(tokens[0]), majorUnit = resolveUnit(tokens[2]),
                labelUnit = resolveUnit(tokens[4]);
            int minorUnitCount = int.Parse(tokens[1]), majorUnitCount = int.Parse(tokens[3]),
                labelUnitCount = int.Parse(tokens[5]);
            int    labelSpan   = int.Parse(tokens[6]);
            String fmt         = tokens[7];

            gdef.setTimeAxis(minorUnit, minorUnitCount, majorUnit, majorUnitCount,
                             labelUnit, labelUnitCount, labelSpan, fmt);
        }