Exemple #1
0
        //
        public ChartAxis(double MainTicks, double MinorTicks, double pMinimum, double pMaximum)
            : base(new List <Type>() { typeof(ChartPadding), typeof(ChartAxis), typeof(ChartData) })
        {
            MyRange = new CappedRange(pMinimum, pMaximum);

            //This filters when what children are added to this instance of ChartAxis
            RegistrationFilter = (
                (object o) =>
            {
                if (o.GetType() == typeof(ChartData))
                {
                    var d = o as ChartData;
                    var axis_label = (Orientation == AxisOrientation.Horizontal) ? d.HorizontalLabel : d.VerticalLabel;
                    return(Label == axis_label);
                }
                return(false);
            });

            //Setup divisions
            this.MainTicks  = MainTicks;
            this.MinorTicks = MinorTicks;

            MaskPaint       = new SKPaint();
            MaskPaint.Color = Globals.BackgroundColor.ToSKColor();

            //Calculate the width of a space charater
            SpaceWidth = MajorPaint.MeasureText(" ");

            //Must be set last as it depends on above
            AxisLocation      = 0.5;
            CircleRadius      = SpaceWidth * 2;
            MajorTickLineSize = 5;

            //
            AxisDrawEvents = new List <ChartAxisDrawEvent>();
            AxisDataEvents = new List <ChartAxisEvent>();
            AxisDataColors = new List <SKColor>();
            AxisDataRanges = new List <Range>();

            //
            Rerange = true;
        }
Exemple #2
0
 public ASmartAxis(string pLabel, float pMinimum, float pMaximum)
 {
     Label = pLabel;
     Range = new CappedRange(pMinimum, pMaximum);
 }