private void InitializeChart()
        {
            if (supportLineChart != null && supportLineChart.ChartData != null && lineChart != null)
            {
                SupportChart.OnInitializeChart(supportLineChart, lineChart);

                var data         = supportLineChart.ChartData;
                var dataSetItems = new List <LineDataSet>();

                foreach (var itemChild in data.IF_GetDataSet())
                {
                    var         entryOriginal = itemChild.IF_GetEntry().Select(item => new MikePhil.Charting.Data.Entry(item.GetXPosition(), item.GetYPosition()));
                    LineDataSet lineDataSet   = new LineDataSet(entryOriginal.ToArray(), itemChild.IF_GetTitle());
                    lineDataSet.Color = itemChild.IF_GetDataColor().ToAndroid();
                    lineDataSet.SetMode(SupportChart.GetDrawLineMode(itemChild.IF_GetDrawMode()));
                    lineDataSet.CircleRadius     = itemChild.IF_GetCircleRadius();
                    lineDataSet.CircleHoleRadius = itemChild.IF_GetCircleHoleRadius();
                    lineDataSet.SetDrawCircles(itemChild.IF_GetDrawCircle());
                    lineDataSet.SetDrawValues(itemChild.IF_GetDrawValue());

                    var arrColor = itemChild.IF_GetCircleColors().Select(item => item.ToAndroid());
                    lineDataSet.SetCircleColor(itemChild.IF_GetCircleColor().ToAndroid());
                    dataSetItems.Add(lineDataSet);
                }

                LineData lineData = new LineData(dataSetItems.ToArray());
                lineChart.Data = lineData;
            }
        }
Esempio n. 2
0
        private void InitializeChart()
        {
            if (supportChart != null && supportChart.ChartData != null && chartOriginal != null)
            {
                SupportChart.OnInitializeChart(supportChart, chartOriginal);
                var data         = supportChart.ChartData;
                var dataSetItems = new List <BarDataSet>();

                foreach (var itemChild in data.IF_GetDataSet())
                {
                    var        entryOriginal = itemChild.IF_GetEntry().Select(item => new MikePhil.Charting.Data.BarEntry(item.GetXPosition(), item.GetYPosition()));
                    BarDataSet lineDataSet   = new BarDataSet(entryOriginal.ToArray(), itemChild.IF_GetTitle());
                    lineDataSet.Color = itemChild.IF_GetDataColor().ToAndroid();
                    lineDataSet.SetDrawValues(itemChild.IF_GetDrawValue());
                    dataSetItems.Add(lineDataSet);
                }

                BarData lineData = new BarData(dataSetItems.ToArray());
                chartOriginal.Data = lineData;
            }
        }