Ejemplo n.º 1
0
        public ILTickWrapper(ILTick source, ILPanelEditor editor, string path, string name = null, string label = null)
            : base(source, editor, path, String.IsNullOrEmpty(name) ? "Tick" : name, label)
        {
            this.source = source;

            this.label = new ILLabelWrapper(source.Label, editor, path, ILTickCollection.TickLabelTag);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// helper function for creating custom ticks with preconfigured labels
        /// </summary>
        /// <param name="val">position of the tick, also used for label text creation</param>
        /// <returns>new tick</returns>
        private ILTick createTick(float val)
        {
            var ret = new ILTick(val, new ILLabel(val.ToString("F2"))
            {
                // right align the tick label to the tick lines
                Anchor = new PointF(1.2f, .5f),
                Color  = Color.Red,
                Font   = new Font("微软雅黑", 9)
            });

            // disable auto updating of the label text. If this is true, LabelCreationFunc is used and overwrites the custom value!
            ret.AutoLabel = false;

            return(ret);
        }