public override SFSeries GetSeries (SFChart chart, nint index)
	{
		SFSplineSeries series		= new SFSplineSeries ();
		series.LineWidth 			= 3;
		series.DataMarker.ShowLabel	= true;
		return series;
	}
    public override SFSeries GetSeries(SFChart chart, nint index)
    {
        SFSplineSeries series = new SFSplineSeries();

        series.Color = UIColor.FromRGBA((nfloat)0.08235, (nfloat)0.2863, (nfloat)0.3098, (nfloat)1.0);
        return(series);
    }
    public override SFSeries GetSeries(SFChart chart, nint index)
    {
        SFSplineSeries series = new SFSplineSeries();

        series.LineWidth            = 3;
        series.DataMarker.ShowLabel = true;
        return(series);
    }
Beispiel #4
0
        private SFChart GetCurrencyDevationChart()
        {
            var sfchart = new SFChart();

            sfchart.Title.Text = "1 USD to INR from 1977 to 2019";

            sfchart.Legend.Visible      = true;
            sfchart.Legend.DockPosition = SFChartLegendPosition.Top;
            sfchart.Legend.IconHeight   = 14;
            sfchart.Legend.IconWidth    = 14;
            sfchart.ColorModel.Palette  = SFChartColorPalette.Natural;
            sfchart.Delegate            = new AxisLabelFormatter();
            SFNumericalAxis numericalaxis = new SFNumericalAxis();

            numericalaxis.AxisLineStyle.LineWidth  = 0;
            numericalaxis.MajorTickStyle.LineWidth = 0;
            numericalaxis.Title.Text = new Foundation.NSString("Rupees against Dollars");
            sfchart.SecondaryAxis    = numericalaxis;

            SFDateTimeAxis primaryAxis = new SFDateTimeAxis();

            primaryAxis.EdgeLabelsDrawingMode = SFChartAxisEdgeLabelsDrawingMode.Shift;
            primaryAxis.ShowMajorGridLines    = false;
            primaryAxis.IntervalType          = SFChartDateTimeIntervalType.Years;
            primaryAxis.Interval           = new NSNumber(8);
            primaryAxis.Title.Text         = new Foundation.NSString("Years");
            primaryAxis.ShowMinorGridLines = false;
            sfchart.PrimaryAxis            = primaryAxis;

            splineSeries1 = new SFSplineSeries();
            splineSeries1.XBindingPath = "XValue";
            splineSeries1.YBindingPath = "YValue";
            splineSeries1.ItemsSource  = ChartViewModel.GetTrendlineDataSource1();
            splineSeries1.Label        = "Rupees";
            splineSeries1.LegendIcon   = SFChartLegendIcon.SeriesType;

            splineSeries1.DataMarker.ShowMarker        = true;
            splineSeries1.DataMarker.ShowLabel         = false;
            splineSeries1.DataMarker.MarkerHeight      = 5;
            splineSeries1.DataMarker.MarkerWidth       = 5;
            splineSeries1.DataMarker.MarkerWidth       = 2;
            splineSeries1.DataMarker.MarkerBorderColor = UIColor.FromName("#00bdae");
            splineSeries1.Trendlines = new ChartTrendlineCollection();
            linearTrendline          = new SFChartTrendline()
            {
                Type            = SFTrendlineType.Linear,
                LineColor       = UIColor.FromRGB(201, 23, 97),
                LegendIcon      = SFChartLegendIcon.SeriesType,
                Label           = "Linear",
                PolynomialOrder = 3,
            };

            splineSeries1.Trendlines.Add(linearTrendline);
            sfchart.Series.Add(splineSeries1);

            return(sfchart);
        }
Beispiel #5
0
        public Tooltip()
        {
            SFChart chart = new SFChart();

            chart.Title.Text = new NSString("Efficiency of oil power Production");

            //Primary Axis

            SFCategoryAxis primaryAxis = new SFCategoryAxis();

            primaryAxis.PlotOffset              = 10;
            primaryAxis.ShowMajorGridLines      = false;
            primaryAxis.AxisLineStyle.LineWidth = new NSNumber(0.5);
            primaryAxis.Interval = new NSNumber(2);
            chart.PrimaryAxis    = primaryAxis;

            // Secondary Axis

            SFNumericalAxis secondaryAxis = new SFNumericalAxis();

            secondaryAxis.EdgeLabelsDrawingMode = SFChartAxisEdgeLabelsDrawingMode.Shift;
            secondaryAxis.Maximum  = new NSNumber(2.701);
            secondaryAxis.Minimum  = new NSNumber(1.5);
            secondaryAxis.Interval = new NSNumber(0.2);
            secondaryAxis.AxisLineStyle.LineWidth = new NSNumber(0);
            secondaryAxis.LabelStyle.Font         = UIFont.FromName("Helvetica", 12f);
            secondaryAxis.Title.Font = UIFont.FromName("Helvetica", 15f);
            secondaryAxis.MajorTickStyle.LineSize      = 0;
            secondaryAxis.MajorGridLineStyle.LineWidth = new NSNumber(0.25);
            chart.SecondaryAxis = secondaryAxis;

            ChartViewModel dataModel = new ChartViewModel();

            SFSplineSeries series = new SFSplineSeries();

            series.ItemsSource   = dataModel.TooltipData;
            series.XBindingPath  = "XValue";
            series.YBindingPath  = "YValue";
            series.EnableTooltip = true;
            //series.Color = UIColor.Orange;
            series.LineWidth                    = 2.5f;
            series.DataMarker.ShowMarker        = true;
            series.DataMarker.MarkerType        = SFChartDataMarkerType.Ellipse;
            series.DataMarker.MarkerHeight      = 5;
            series.DataMarker.MarkerWidth       = 5;
            series.DataMarker.MarkerBorderColor = UIColor.Black;
            series.DataMarker.MarkerColor       = UIColor.FromRGBA(193.0f / 255.0f, 39.0f / 255.0f, 45.0f / 255.0f, 1.0f);
            series.EnableAnimation              = true;
            chart.Series.Add(series);
            chart.Delegate = new ChartTooltipDelegate();
            SFChartTooltipBehavior behavior = new SFChartTooltipBehavior();

            behavior.BackgroundColor = UIColor.FromRGBA(193.0f / 255.0f, 39.0f / 255.0f, 45.0f / 255.0f, 1.0f);
            chart.AddChartBehavior(behavior);

            this.AddSubview(chart);
        }
Beispiel #6
0
        private SFChart GetMeterDevationChart()
        {
            var sfchart = new SFChart();

            sfchart.Title.Text = "Distance Measurement";

            sfchart.Legend.Visible      = true;
            sfchart.Legend.DockPosition = SFChartLegendPosition.Top;
            sfchart.Legend.IconHeight   = 14;
            sfchart.Legend.IconWidth    = 14;
            sfchart.ColorModel.Palette  = SFChartColorPalette.Natural;

            SFNumericalAxis numericalaxis = new SFNumericalAxis();

            numericalaxis.AxisLineStyle.LineWidth  = 0;
            numericalaxis.MajorTickStyle.LineWidth = 0;
            numericalaxis.Title.Text = new Foundation.NSString("Meters");
            sfchart.SecondaryAxis    = numericalaxis;

            SFNumericalAxis primaryAxis = new SFNumericalAxis();

            primaryAxis.ShowMajorGridLines = false;
            primaryAxis.Title.Text         = new Foundation.NSString("Seconds");
            primaryAxis.ShowMinorGridLines = false;
            sfchart.PrimaryAxis            = primaryAxis;

            splineSeries2              = new SFSplineSeries();
            splineSeries2.ItemsSource  = ChartViewModel.GetTrendlineDataSource2();
            splineSeries2.XBindingPath = "XValue";
            splineSeries2.YBindingPath = "YValue";
            splineSeries2.Label        = "Rupees";
            splineSeries2.LegendIcon   = SFChartLegendIcon.SeriesType;

            splineSeries2.DataMarker.ShowMarker        = true;
            splineSeries2.DataMarker.ShowLabel         = false;
            splineSeries2.DataMarker.MarkerHeight      = 5;
            splineSeries2.DataMarker.MarkerWidth       = 5;
            splineSeries2.DataMarker.MarkerBorderWidth = 2;
            splineSeries2.DataMarker.MarkerBorderColor = UIColor.FromName("#00bdae");

            splineSeries2.Trendlines = new ChartTrendlineCollection();
            powerTrendline           = new SFChartTrendline()
            {
                Type       = SFTrendlineType.Power,
                LineColor  = UIColor.FromRGB(201, 23, 97),
                LegendIcon = SFChartLegendIcon.SeriesType,
                Label      = "Power"
            };

            splineSeries2.Trendlines.Add(powerTrendline);
            sfchart.Series.Add(splineSeries2);
            return(sfchart);
        }
Beispiel #7
0
        public Spline()
        {
            SFChart chart = new SFChart();

            chart.Title.Text         = new NSString("Climate Graph");
            chart.ColorModel.Palette = SFChartColorPalette.Natural;

            SFCategoryAxis primaryAxis = new SFCategoryAxis();

            chart.PrimaryAxis              = primaryAxis;
            primaryAxis.LabelPlacement     = SFChartLabelPlacement.BetweenTicks;
            primaryAxis.Title.Text         = new NSString("Month");
            chart.SecondaryAxis            = new SFNumericalAxis();
            chart.SecondaryAxis.Title.Text = new NSString("Temperature (celsius)");
            ChartViewModel dataModel = new ChartViewModel();

            SFSplineSeries series1 = new SFSplineSeries();

            series1.ItemsSource             = dataModel.SplineData1;
            series1.XBindingPath            = "XValue";
            series1.YBindingPath            = "YValue";
            series1.EnableTooltip           = true;
            series1.DataMarker.ShowMarker   = true;
            series1.DataMarker.MarkerHeight = 5;
            series1.DataMarker.MarkerWidth  = 5;
            series1.Label           = "London";
            series1.EnableAnimation = true;
            chart.Series.Add(series1);

            SFSplineSeries series2 = new SFSplineSeries();

            series2.ItemsSource             = dataModel.SplineData2;
            series2.XBindingPath            = "XValue";
            series2.YBindingPath            = "YValue";
            series2.EnableTooltip           = true;
            series2.DataMarker.MarkerHeight = 5;
            series2.DataMarker.MarkerWidth  = 5;
            series2.DataMarker.ShowMarker   = true;
            series2.Label           = "France";
            series2.EnableAnimation = true;
            chart.Series.Add(series2);


            chart.Legend.Visible = true;
            chart.Legend.ToggleSeriesVisibility = true;
            chart.Legend.IconWidth    = 14;
            chart.Legend.IconHeight   = 14;
            chart.Legend.DockPosition = SFChartLegendPosition.Bottom;
            chart.AddChartBehavior(new SFChartZoomPanBehavior());
            this.AddSubview(chart);
        }
Beispiel #8
0
 public override SFSeries GetSeries(SFChart chart, nint index)
 {
     if (index == 1)
     {
         SFSplineSeries series = new SFSplineSeries();
         series.Label = new NSString(StaticValues.ReportExpenseAverage);
         series.YAxis = getYAxis();
         return(series);
     }
     else
     {
         SFColumnSeries series = new SFColumnSeries();
         series.Label = new NSString(StaticValues.ReportTopCategoriesLabel);
         series.YAxis = getYAxis();
         return(series);
     }
 }
Beispiel #9
0
        public Spline()
        {
            SFChart chart = new SFChart();

            chart.Title.Text         = new NSString("NC Weather Report");
            chart.ColorModel.Palette = SFChartColorPalette.Natural;

            SFCategoryAxis primaryAxis = new SFCategoryAxis();

            chart.PrimaryAxis              = primaryAxis;
            primaryAxis.LabelPlacement     = SFChartLabelPlacement.BetweenTicks;
            primaryAxis.ShowMajorGridLines = false;
            chart.SecondaryAxis            = new SFNumericalAxis();
            chart.SecondaryAxis.Minimum    = new NSNumber(0);
            chart.SecondaryAxis.Maximum    = new NSNumber(40);
            chart.SecondaryAxis.Interval   = new NSNumber(10);
            chart.SecondaryAxis.AxisLineStyle.LineWidth = 0;
            chart.SecondaryAxis.MajorTickStyle.LineSize = 0;
            NSNumberFormatter formatter = new NSNumberFormatter();

            formatter.PositiveSuffix = "°C";
            chart.SecondaryAxis.LabelStyle.LabelFormatter = formatter;
            ChartViewModel dataModel = new ChartViewModel();

            SFSplineSeries series1 = new SFSplineSeries();

            series1.ItemsSource                  = dataModel.SplineData1;
            series1.XBindingPath                 = "XValue";
            series1.YBindingPath                 = "YValue";
            series1.EnableTooltip                = true;
            series1.DataMarker.ShowMarker        = true;
            series1.DataMarker.MarkerHeight      = 10;
            series1.DataMarker.MarkerWidth       = 10;
            series1.DataMarker.MarkerBorderColor = UIColor.FromRGBA(0.0f / 255.0f, 189.0f / 255.0f, 174.0f / 255.0f, 1.0f);
            series1.DataMarker.MarkerBorderWidth = 2;
            series1.DataMarker.MarkerColor       = UIColor.White;
            series1.Label           = "Max Temp";
            series1.EnableAnimation = true;
            series1.LegendIcon      = SFChartLegendIcon.SeriesType;
            chart.Series.Add(series1);

            SFSplineSeries series2 = new SFSplineSeries();

            series2.ItemsSource                  = dataModel.SplineData2;
            series2.XBindingPath                 = "XValue";
            series2.YBindingPath                 = "YValue";
            series2.EnableTooltip                = true;
            series2.DataMarker.MarkerHeight      = 10;
            series2.DataMarker.MarkerWidth       = 10;
            series2.DataMarker.ShowMarker        = true;
            series2.DataMarker.MarkerBorderColor = UIColor.FromRGBA(64.0f / 255.0f, 64.0f / 255.0f, 65.0f / 255.0f, 1.0f);
            series2.DataMarker.MarkerBorderWidth = 2;
            series2.DataMarker.MarkerColor       = UIColor.White;
            series2.Label           = "Avg Temp";
            series2.EnableAnimation = true;
            series2.LegendIcon      = SFChartLegendIcon.SeriesType;
            chart.Series.Add(series2);

            SFSplineSeries series3 = new SFSplineSeries();

            series3.ItemsSource                  = dataModel.SplineData3;
            series3.XBindingPath                 = "XValue";
            series3.YBindingPath                 = "YValue";
            series3.EnableTooltip                = true;
            series3.DataMarker.MarkerHeight      = 10;
            series3.DataMarker.MarkerWidth       = 10;
            series3.DataMarker.ShowMarker        = true;
            series3.DataMarker.MarkerBorderColor = UIColor.FromRGBA(53.0f / 255.0f, 124.0f / 255.0f, 210.0f / 255.0f, 1.0f);
            series3.DataMarker.MarkerBorderWidth = 2;
            series3.DataMarker.MarkerColor       = UIColor.White;
            series3.Label           = "Min Temp";
            series3.EnableAnimation = true;
            series3.LegendIcon      = SFChartLegendIcon.SeriesType;
            chart.Series.Add(series3);

            chart.Legend.Visible = true;
            chart.Legend.ToggleSeriesVisibility = true;
            chart.Legend.IconWidth    = 14;
            chart.Legend.IconHeight   = 14;
            chart.Legend.DockPosition = SFChartLegendPosition.Bottom;
            this.AddSubview(chart);
        }
	public override SFSeries GetSeries (SFChart chart, nint index)
	{
		SFSplineSeries series	= new SFSplineSeries ();
		series.Color			= UIColor.FromRGBA((nfloat)0.08235,(nfloat)0.2863,(nfloat)0.3098,(nfloat)1.0);
		return series;
	}
Beispiel #11
0
        public override void AddData(List <string> data, string varName, string title, string extra)
        {
            if (m_grid != null)
            {
                if (title == "columns")
                {
                    m_model.AddColumns(data);
                }
                else if (title == "item")
                {
                    m_model.AddPoint(data);
                }
            }
            else if (m_chart != null)
            {
                var collection = new ObservableCollection <DataPoint>();
                for (int i = 0; i < data.Count - 1; i += 2)
                {
                    string coord = data[i];
                    double value = Utils.ConvertToDouble(data[i + 1]);
                    collection.Add(new DataPoint(coord, value));
                }
                if (SfType == SyncFusionType.DOUGHNUT_GRAPH)
                {
                    SFDoughnutSeries doughnutSeries = new SFDoughnutSeries();
                    doughnutSeries.ItemsSource     = collection;
                    doughnutSeries.XBindingPath    = "XValue";
                    doughnutSeries.YBindingPath    = "YValue";
                    doughnutSeries.EnableTooltip   = true;
                    doughnutSeries.EnableAnimation = true;
                    if (!string.IsNullOrEmpty(title))
                    {
                        //doughnutSeries.Label = title;
                        m_chart.Title.Text = (NSString)title;
                    }
                    doughnutSeries.DataMarker.ShowLabel    = true;
                    doughnutSeries.DataMarker.LabelContent = title == "values" ? SFChartLabelContent.YValue :
                                                             SFChartLabelContent.Percentage;
                    doughnutSeries.DataMarkerPosition = SFChartCircularSeriesLabelPosition.OutsideExtended;
                    doughnutSeries.LegendIcon         = SFChartLegendIcon.Circle;
                    if (!string.IsNullOrEmpty(extra))
                    {
                        var angles = extra.Split(new char[] { ',', ':' });
                        doughnutSeries.StartAngle = Utils.ConvertToDouble(angles[0]);
                        if (angles.Length > 1)
                        {
                            doughnutSeries.EndAngle = Utils.ConvertToDouble(angles[1]);
                        }
                    }
                    m_chart.Series.Add(doughnutSeries);
                }
                else if (SfType == SyncFusionType.SPLINE_GRAPH)
                {
                    SFSplineSeries splineSeries = new SFSplineSeries();
                    splineSeries.ItemsSource             = collection;
                    splineSeries.XBindingPath            = "XValue";
                    splineSeries.YBindingPath            = "YValue";
                    splineSeries.EnableTooltip           = true;
                    splineSeries.EnableAnimation         = true;
                    splineSeries.Label                   = title;
                    splineSeries.DataMarker.MarkerHeight = 5;
                    splineSeries.DataMarker.MarkerWidth  = 5;
                    splineSeries.DataMarker.ShowMarker   = true;
                    splineSeries.LegendIcon              = SFChartLegendIcon.Rectangle;
                    if (!string.IsNullOrEmpty(extra))
                    {
                        var colors = extra.Split(new char[] { ',', ':' });
                        splineSeries.Color = UtilsiOS.String2Color(colors[0]);
                        if (colors.Length > 1)
                        {
                            var color = UtilsiOS.String2Color(colors[1]);
                            splineSeries.DataMarker.MarkerColor = color;
                        }
                    }
                    m_chart.Series.Add(splineSeries);
                }

                if (!string.IsNullOrEmpty(title))
                {
                    m_chart.Legend.Visible      = true;
                    m_chart.Legend.DockPosition = SFChartLegendPosition.Top;
                    //m_chart.Legend.
                    m_chart.Legend.ToggleSeriesVisibility = true;
                }
            }
            else if (m_picker != null)
            {
                m_strings            = data;
                m_picker.ItemsSource = data;
            }
        }