Ejemplo n.º 1
0
            // >> chart-ohlc-visual-cs
            public override TKChartPaletteItem PaletteItemForSeries(TKChart chart, TKChartSeries series, nint index)
            {
                var      dataPoint = series.DataPointAtIndex((uint)index);
                TKStroke stroke    = null;

                if (dataPoint.Close.DoubleValue < dataPoint.Open.DoubleValue)
                {
                    stroke = new TKStroke(UIColor.Red);
                }
                else
                {
                    stroke = new TKStroke(UIColor.Green);
                }
                var paletteItem = new TKChartPaletteItem(stroke);

                return(paletteItem);
            }
Ejemplo n.º 2
0
            // >> chart-candlestick-visual-cs
            public override TKChartPaletteItem PaletteItemForSeries(TKChart chart, TKChartSeries series, nint index)
            {
                var dataPoint = series.DataPointAtIndex((uint)index);
                var stroke    = new TKStroke(UIColor.Black);
                var fill      = new TKSolidFill();

                if (dataPoint.Close.DoubleValue < dataPoint.Open.DoubleValue)
                {
                    fill.Color = UIColor.Red;
                }
                else
                {
                    fill.Color = UIColor.Green;
                }
                var paletteItem = new TKChartPaletteItem(stroke, fill);

                return(paletteItem);
            }