Exemple #1
0
        private void TrySetGradientBarTemplate(BarSeries nativeBarSeries, TXFC.CartesianSeries xfSeries)
        {
            XF.Color xfStartColor = EXAMPLE.GradientBarsEffect.GetStartColor(xfSeries);
            XF.Color xfEndColor   = EXAMPLE.GradientBarsEffect.GetEndColor(xfSeries);
            if (xfStartColor == XF.Color.Default || xfEndColor == XF.Color.Default)
            {
                return;
            }

            Color startColor = ToWinColor(xfStartColor);
            Color endColor   = ToWinColor(xfEndColor);

            string xamlString = @"
<DataTemplate xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"">
    <Border>
        <Border.Background>
            <LinearGradientBrush StartPoint=""0.5, 1"" EndPoint=""0.5, 0"">
                <GradientStop Offset=""0"" Color=""" + startColor + @""" />
                <GradientStop Offset=""1"" Color=""" + endColor + @""" />
            </LinearGradientBrush>
        </Border.Background>
    </Border>
</DataTemplate>";

            nativeBarSeries.PointTemplate = (DataTemplate)Windows.UI.Xaml.Markup.XamlReader.Load(xamlString);
        }
Exemple #2
0
        private void TrySetPointMarkRenderer(LineSeries lineSeries, TXFC.CartesianSeries xfSeries)
        {
            XF.Color xfColor = EXAMPLE.PointMarksEffect.GetColor(xfSeries);
            if (xfColor == XF.Color.Default)
            {
                return;
            }

            lineSeries.DataPointRenderer = new PointMarkRenderer(ColorExtensions.ToAndroid(xfColor));
        }
        private void TrySetGradientBarFill(TKChartColumnSeries columnSeries, TXFC.CartesianSeries xfSeries)
        {
            XF.Color xfStartColor = EXAMPLE.GradientBarsEffect.GetStartColor(xfSeries);
            XF.Color xfEndColor   = EXAMPLE.GradientBarsEffect.GetEndColor(xfSeries);
            if (xfStartColor == XF.Color.Default || xfEndColor == XF.Color.Default)
            {
                return;
            }

            columnSeries.Style.Palette = CreatePalette(ColorExtensions.ToUIColor(xfStartColor), ColorExtensions.ToUIColor(xfEndColor));
        }
Exemple #4
0
        private void TrySetGradientBarRenderer(BarSeries barSeries, TXFC.CartesianSeries xfSeries)
        {
            XF.Color xfStartColor = EXAMPLE.GradientBarsEffect.GetStartColor(xfSeries);
            XF.Color xfEndColor   = EXAMPLE.GradientBarsEffect.GetEndColor(xfSeries);
            if (xfStartColor == XF.Color.Default || xfEndColor == XF.Color.Default)
            {
                return;
            }

            barSeries.DataPointRenderer = new GradientBarRenderer(ColorExtensions.ToAndroid(xfStartColor), ColorExtensions.ToAndroid(xfEndColor));
        }
        private void TrySetPointMarkFill(TKChartLineSeries lineSeries, TXFC.CartesianSeries xfSeries)
        {
            XF.Color xfColor = EXAMPLE.PointMarksEffect.GetColor(xfSeries);
            if (xfColor == XF.Color.Default)
            {
                return;
            }

            lineSeries.Style.ShapeMode    = TKChartSeriesStyleShapeMode.AlwaysShow;
            lineSeries.Style.PointShape   = new TKPredefinedShape(TKShapeType.Circle, new CGSize(10, 10));
            lineSeries.Style.Palette      = CreatePalette(ColorExtensions.ToUIColor(xfColor));
            lineSeries.Style.ShapePalette = lineSeries.Style.Palette;
        }
Exemple #6
0
        private void TrySetPointMarkTemplate(LineSeries nativeLineSeries, TXFC.CartesianSeries xfSeries)
        {
            XF.Color xfColor = EXAMPLE.PointMarksEffect.GetColor(xfSeries);
            if (xfColor == XF.Color.Default)
            {
                nativeLineSeries.PointTemplate = null;
                return;
            }

            Color color = ToWinColor(xfColor);

            string xamlString = @"
<DataTemplate xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"">
    <Ellipse Width=""10"" Height=""10"" Fill=""" + color + @""" />
</DataTemplate>";

            nativeLineSeries.PointTemplate = (DataTemplate)Windows.UI.Xaml.Markup.XamlReader.Load(xamlString);
        }