Beispiel #1
0
        protected override float[] GetXPositions()
        {
            if (barChartPositioner == null)
            {
                return(new float[0]);
            }

            int axisFirstVisibleIndex = (int)barChartPositioner.axisBounds.XMin;

            float[] positions = new float[barChartPositioner.GetVisibleEntriesRange()];
            for (int i = 0; i < positions.Length; i++)
            {
                positions[i] = barChartPositioner.GetBarCenterPosition(i + axisFirstVisibleIndex).x;
            }

            return(positions);
        }
Beispiel #2
0
        public List <AxisLabelRendererExtry> getLabelRendererEntries()
        {
            List <AxisLabelRendererExtry> entries = new List <AxisLabelRendererExtry> ();

            if (barChartPositioner == null)
            {
                return(entries);
            }

            int entriesCount          = barChartPositioner.GetVisibleEntriesRange();
            int axisFirstVisibleIndex = (int)barChartPositioner.axisBounds.XMin;

            for (int i = axisFirstVisibleIndex; i < entriesCount + axisFirstVisibleIndex; i++)
            {
                AxisLabelRendererExtry entry = new AxisLabelRendererExtry();
                entry.PositionOnAxis = barChartPositioner.GetBarCenterPosition(i).x;
                entry.Gravity        = labelsGravity;
                entry.Text           = GetLabelValueText(i, axisFirstVisibleIndex, entriesCount + axisFirstVisibleIndex);
                entry.Orientation    = AxisOrientation.HORIZONTAL;
                entries.Add(entry);
            }

            return(entries);
        }