public override void LoadView ()
		{
			// Create a chart view that will display the chart.
			m_view = new NChartView ();

			// Paste your license key here.
			m_view.Chart.LicenseKey = "";

			// Switch on antialiasing.
			m_view.Chart.ShouldAntialias = true;

			// Margin to ensure some free space for the iOS status bar.
			m_view.Chart.CartesianSystem.Margin = new NChartMargin (10.0f, 10.0f, 10.0f, 20.0f);

			// Create series that will be displayed on the chart.
			NChartColumnSeries series = new NChartColumnSeries ();

			// Set brush that will fill that series with color.
			series.Brush = NChartSolidColorBrush.SolidColorBrushWithColor (UIColor.FromRGBA (97, 206, 231, 255));

			// Set data source for the series.
			series.DataSource = this;

			// Add series to the chart.
			m_view.Chart.AddSeries (series);

			// Update data in the chart.
			m_view.Chart.UpdateData ();

			// Set delegate to the chart.
			m_view.Chart.Delegate = this;

			// Set chart view to the controller.
			this.View = m_view;
		}
Ejemplo n.º 2
0
		public MultipleViewsView () : base ()
		{
			this.view1 = new NChartView ();
			this.AddSubview (view1);
			this.view2 = new NChartView ();
			this.AddSubview (view2);

			this.BackgroundColor = UIColor.White;
		}
Ejemplo n.º 3
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			// Set our view from the "main" layout resource
			SetContentView (Resource.Layout.Main);

			mNChartView = FindViewById <NChartView> (Resource.Id.surface);

			LoadView ();
		}
		public override void LoadView ()
		{
			// Create a chart view that will display the chart.
			m_view = new NChartView ();

			// Paste your license key here.
			m_view.Chart.LicenseKey = "";

			m_view.Chart.PolarSystem.Margin = new NChartMargin (10.0f, 10.0f, 10.0f, 20.0f);

			for (int i = 0; i < 3; ++i) {
				// Create series that will be displayed on the chart.
				NChartPieSeries series = new NChartPieSeries ();

				// Set data source for the series.
				series.DataSource = this;

				// Set tag of the series.
				series.Tag = i;

				// Set brush that will fill that series with color.
				series.Brush = brushes[i];

				// Add series to the chart.
				m_view.Chart.AddSeries (series);
			}

			// Update data in the chart.
			m_view.Chart.UpdateData ();

			// Set chart view to the controller.
			this.View = m_view;

			// Set delegate to the chart.
			m_view.Chart.Delegate = this;

			// We set the minimal zoom to 0.85 (its default is 1.0) because we will
			// then shift the highlighted sectors of the pie away from the center.
			// We need to zoom out the pie to prevent the shifted sectors from hiding
			// behind the screen's border.
			// If the minimal zoom is larger than the zoom we set by zoomTo:duration:delay:,
			// chart will be bounced back to the minimal zoom immediately.
			m_view.Chart.MinZoom = 0.85f;

			// Uncomment this line to get the animated transition.
			// m_view.Chart.PlayTransition(1.0f, false);
		}
Ejemplo n.º 5
0
        public override void LoadView()
        {
            // Create a chart view that will display the chart.
            m_view = new NChartView();

            // Paste your license key here.
            m_view.Chart.LicenseKey = "";

            // Switch on antialiasing.
            m_view.Chart.ShouldAntialias = true;

            if (drawIn3D)
            {
                // Switch 3D on.
                m_view.Chart.DrawIn3D = true;
                // Margin to ensure some free space for the iOS status bar and Y-Axis tick titles.
                m_view.Chart.CartesianSystem.Margin = new NChartMargin(50.0f, 50.0f, 10.0f, 20.0f);
                m_view.Chart.PolarSystem.Margin     = new NChartMargin(50.0f, 50.0f, 10.0f, 20.0f);
            }
            else
            {
                // Margin to ensure some free space for the iOS status bar.
                m_view.Chart.CartesianSystem.Margin = new NChartMargin(10.0f, 10.0f, 10.0f, 20.0f);
                m_view.Chart.PolarSystem.Margin     = new NChartMargin(10.0f, 10.0f, 10.0f, 20.0f);
            }

            // Create series that will be displayed on the chart.
            NChartLineSeries series = stepMode ? new NChartStepSeries() : new NChartLineSeries();

            series.DataSource    = this;
            series.Tag           = 0;
            series.Brush         = new NChartSolidColorBrush(UIColor.FromRGB(97, 206, 231));
            series.LineThickness = 3.0f;
            m_view.Chart.AddSeries(series);

            m_view.Chart.CartesianSystem.XAxis.HasOffset = true;
            m_view.Chart.CartesianSystem.YAxis.HasOffset = false;
            m_view.Chart.CartesianSystem.ZAxis.HasOffset = true;

            // Update data in the chart.
            m_view.Chart.UpdateData();

            // Set chart view to the controller.
            this.View = m_view;
        }
Ejemplo n.º 6
0
        public override void LoadView()
        {
            // Create a chart view that will display the chart.
            m_view = new NChartView();

            // Paste your license key here.
            m_view.Chart.LicenseKey = "";

            // Switch on antialiasing.
            m_view.Chart.ShouldAntialias = true;

            if (drawIn3D)
            {
                // Switch 3D on.
                m_view.Chart.DrawIn3D = true;
                // Margin to ensure some free space for the iOS status bar and Y-Axis tick titles.
                m_view.Chart.CartesianSystem.Margin = new NChartMargin(50.0f, 50.0f, 10.0f, 20.0f);
                m_view.Chart.PolarSystem.Margin     = new NChartMargin(50.0f, 50.0f, 10.0f, 20.0f);
            }
            else
            {
                // Margin to ensure some free space for the iOS status bar.
                m_view.Chart.CartesianSystem.Margin = new NChartMargin(10.0f, 10.0f, 10.0f, 20.0f);
                m_view.Chart.PolarSystem.Margin     = new NChartMargin(10.0f, 10.0f, 10.0f, 20.0f);
            }

            // Create series that will be displayed on the chart.
            for (int i = 0; i < 3; ++i)
            {
                NChartBarSeries series = new NChartBarSeries();
                series.DataSource = this;
                series.Tag        = i;
                series.Brush      = brushes [i];
                m_view.Chart.AddSeries(series);
            }
            m_view.Chart.CartesianSystem.XAxis.HasOffset = false;
            m_view.Chart.CartesianSystem.YAxis.HasOffset = true;
            m_view.Chart.CartesianSystem.ZAxis.HasOffset = true;

            // Update data in the chart.
            m_view.Chart.UpdateData();

            // Set chart view to the controller.
            this.View = m_view;
        }
Ejemplo n.º 7
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Stick Stock";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XYLinear);

            // setup X axis
            NCartesianAxis axis = m_Chart.Axes[ENCartesianAxis.PrimaryX];

            axis.Scale = new NValueTimelineScale();

            // setup primary Y axis
            axis = m_Chart.Axes[ENCartesianAxis.PrimaryY];
            NLinearScale linearScale = (NLinearScale)axis.Scale;

            // configure ticks and grid lines
            linearScale.MajorGridLines.Stroke   = new NStroke(NColor.LightGray);
            linearScale.InnerMajorTicks.Visible = false;

            // add interlaced stripe
            NScaleStrip strip = new NScaleStrip();

            strip.Fill       = new NColorFill(NColor.Beige);
            strip.Interlaced = true;
            linearScale.Strips.Add(strip);

            // Setup the stock series
            m_Stock = new NStockSeries();
            m_Chart.Series.Add(m_Stock);

            m_Stock.DataLabelStyle = new NDataLabelStyle(false);
            m_Stock.CandleShape    = ENCandleShape.Stick;
            m_Stock.CandleWidth    = 4;
            m_Stock.UseXValues     = true;

            GenerateData();

            return(chartView);
        }
Ejemplo n.º 8
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Standard Point";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XYLinear);

            // add interlace stripe
            NLinearScale linearScale = m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale as NLinearScale;
            NScaleStrip  strip       = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;

            // setup point series
            m_Point = new NPointSeries();

            //m_Point.DataLabelStyle.ArrowLength = 20;

            m_Point.Name           = "Point Series";
            m_Point.InflateMargins = true;
            m_Point.DataLabelStyle = new NDataLabelStyle(false);

            m_Point.DataPoints.Add(new NPointDataPoint(23, "Item1"));
            m_Point.DataPoints.Add(new NPointDataPoint(67, "Item2"));
            m_Point.DataPoints.Add(new NPointDataPoint(78, "Item3"));
            m_Point.DataPoints.Add(new NPointDataPoint(12, "Item4"));
            m_Point.DataPoints.Add(new NPointDataPoint(56, "Item5"));
            m_Point.DataPoints.Add(new NPointDataPoint(43, "Item6"));
            m_Point.DataPoints.Add(new NPointDataPoint(37, "Item7"));
            m_Point.DataPoints.Add(new NPointDataPoint(51, "Item8"));

            m_Point.Fill = new NColorFill(NColor.Red);

            m_Chart.Series.Add(m_Point);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, true));

            return(chartView);
        }
		public override void LoadView ()
		{
			// Create a chart view that will display the chart.
			m_view = new NChartView ();

			// Paste your license key here.
			m_view.Chart.LicenseKey = "";

			// Margin to ensure some free space for the iOS status bar.
			m_view.Chart.CartesianSystem.Margin = new NChartMargin (10.0f, 10.0f, 10.0f, 20.0f);

			// Array of colors for the series.
			int[,] colors = new int[3, 3] {
				{ 97, 206, 231 },
				{ 203, 220, 56 },
				{ 229, 74, 131 }
			};

			// Create column series with colors from the array and add them to the chart.
			for (int i = 0; i < 3; ++i) {
				NChartColumnSeries series = new NChartColumnSeries ();
				series.Brush = NChartSolidColorBrush.SolidColorBrushWithColor (UIColor.FromRGB (colors [i, 0], colors [i, 1], colors [i, 2]));
				series.DataSource = this;

				// The third series should be hosted on the secondary Y-Axis (so called SY-Axis).
				if (i == 2)
					series.HostsOnSY = true;

				// Tag is used to get data for a particular series in the data source.
				series.Tag = i;

				m_view.Chart.AddSeries (series);
			}

			// Set the data source for the X- and SY-Axis, because we want custom values on them.
			m_view.Chart.CartesianSystem.XAxis.DataSource = this;
			m_view.Chart.CartesianSystem.SYAxis.DataSource = this;

			// Update data in the chart.
			m_view.Chart.UpdateData ();

			// Set chart view to the controller.
			this.View = m_view;
		}
Ejemplo n.º 10
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            chartView.Surface.Titles[0].Text = "Axis Strips";

            // configure chart
            NCartesianChart chart = (NCartesianChart)chartView.Surface.Charts[0];

            // configure axes
            chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);
            NLinearScale scaleY = (NLinearScale)chart.Axes[ENCartesianAxis.PrimaryY].Scale;

            // add interlaced stripe
            m_Strip            = new NScaleStrip(new NColorFill(NColor.DarkGray), null, true, 0, 0, 1, 1);
            m_Strip.Interlaced = true;
            scaleY.Strips.Add(m_Strip);

            // enable the major y grid lines
            scaleY.MajorGridLines = new NScaleGridLines();

            NOrdinalScale scaleX = (NOrdinalScale)chart.Axes[ENCartesianAxis.PrimaryX].Scale;

            // enable the major x grid lines
            scaleX.MajorGridLines = new NScaleGridLines();

            // create dummy data
            NBarSeries bar = new NBarSeries();

            bar.Name           = "Bars";
            bar.DataLabelStyle = new NDataLabelStyle(false);
            Random random = new Random();

            for (int i = 0; i < 10; i++)
            {
                bar.DataPoints.Add(new NBarDataPoint(random.Next(100)));
            }

            chart.Series.Add(bar);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
Ejemplo n.º 11
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Date Time Scale";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];
            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XDateTimeYLinear);

            // add interlaced stripe to the Y axis
            NLinearScale yScale     = (NLinearScale)m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale;
            NScaleStrip  stripStyle = new NScaleStrip(new NColorFill(NColor.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            yScale.Strips.Add(stripStyle);

            // Add a line series (data will be generated with example controls)
            NLineSeries line = new NLineSeries();

            m_Chart.Series.Add(line);

            line.UseXValues = true;

            line.DataLabelStyle = new NDataLabelStyle(false);
            line.InflateMargins = true;

            NMarkerStyle markerStyle = new NMarkerStyle();

            markerStyle.Visible = true;
            line.MarkerStyle    = markerStyle;

            // create a date time scale
            m_DateTimeScale = (NDateTimeScale)m_Chart.Axes[ENCartesianAxis.PrimaryX].Scale;

            m_DateTimeScale.Labels.Style.Angle            = new NScaleLabelAngle(ENScaleLabelAngleMode.Scale, 90);
            m_DateTimeScale.Labels.Style.ContentAlignment = ENContentAlignment.TopCenter;

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
Ejemplo n.º 12
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "XY Scatter Point";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XYLinear);

            // setup X axis
            NLinearScale scaleX = new NLinearScale();

            scaleX.MajorGridLines = new NScaleGridLines();
            scaleX.MajorGridLines.Stroke.DashStyle       = ENDashStyle.Dot;
            m_Chart.Axes[ENCartesianAxis.PrimaryX].Scale = scaleX;

            // setup Y axis
            NLinearScale scaleY = new NLinearScale();

            scaleY.MajorGridLines = new NScaleGridLines();
            scaleY.MajorGridLines.Stroke.DashStyle       = ENDashStyle.Dot;
            m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale = scaleY;

            // add a point series
            m_Point                = new NPointSeries();
            m_Point.Name           = "Point Series";
            m_Point.DataLabelStyle = new NDataLabelStyle(false);
            m_Point.Fill           = new NColorFill(new NColor(NColor.DarkOrange, 160));
            m_Point.Size           = 5;
            m_Point.Shape          = ENPointShape.Ellipse;
            m_Point.UseXValues     = true;
            m_Chart.Series.Add(m_Point);

            OnNewDataButtonClick(null);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
Ejemplo n.º 13
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Chart Orientation";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            m_Chart.Orientation = ENCartesianChartOrientation.LeftToRight;
            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // add interlace stripe
            NLinearScale linearScale = m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale as NLinearScale;
            NScaleStrip  strip       = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;
            linearScale.Strips.Add(strip);

            // add a bar series
            m_Bar1 = new NBarSeries();
            m_Bar1.MultiBarMode = ENMultiBarMode.Series;
            m_Bar1.Name         = "Bar 1";

            NDataLabelStyle dataLabelStyle = new NDataLabelStyle();

            dataLabelStyle.Format  = "<value>";
            dataLabelStyle.Visible = true;

            m_Bar1.DataLabelStyle = dataLabelStyle;

            m_Bar1.LegendView.Mode = ENSeriesLegendMode.DataPoints;

            m_Chart.Series.Add(m_Bar1);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, true));

            OnPositiveDataButtonClick(null);

            return(chartView);
        }
Ejemplo n.º 14
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateFunnelChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Scatter Funnel";

            NFunnelChart funnelChart = (NFunnelChart)chartView.Surface.Charts[0];

            m_FunnelSeries            = new NFunnelSeries();
            m_FunnelSeries.UseXValues = true;
            m_FunnelSeries.Shape      = ENFunnelShape.Rectangle;
            funnelChart.Series.Add(m_FunnelSeries);

            GenerateData();

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, true));

            return(chartView);
        }
Ejemplo n.º 15
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Cluster Bar Labels";

            // configure chart
            NCartesianChart chart = (NCartesianChart)chartView.Surface.Charts[0];

            chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // add interlace stripe
            NLinearScale linearScale = chart.Axes[ENCartesianAxis.PrimaryY].Scale as NLinearScale;
            NScaleStrip  strip       = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;
            linearScale.Strips.Add(strip);

            // add a bar series
            m_Bar1                = new NBarSeries();
            m_Bar1.Name           = "Bar1";
            m_Bar1.MultiBarMode   = ENMultiBarMode.Series;
            m_Bar1.DataLabelStyle = CreateDataLabelStyle();
            m_Bar1.ValueFormatter = new NNumericValueFormatter("0.###");
            chart.Series.Add(m_Bar1);

            // add another bar series
            m_Bar2                = new NBarSeries();
            m_Bar2.Name           = "Bar2";
            m_Bar2.MultiBarMode   = ENMultiBarMode.Clustered;
            m_Bar2.DataLabelStyle = CreateDataLabelStyle();
            m_Bar2.ValueFormatter = new NNumericValueFormatter("0.###");
            chart.Series.Add(m_Bar2);

            FillRandomData();

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
Ejemplo n.º 16
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Chart Themes";

            // configure chart
            NCartesianChart chart = (NCartesianChart)chartView.Surface.Charts[0];

            chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // add interlace stripe
            NLinearScale linearScale = chart.Axes[ENCartesianAxis.PrimaryY].Scale as NLinearScale;
            NScaleStrip  strip       = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;
            linearScale.Strips.Add(strip);

            // add a bar series
            Random random = new Random();

            for (int i = 0; i < 6; i++)
            {
                NBarSeries bar = new NBarSeries();
                bar.Name           = "Bar" + i.ToString();
                bar.MultiBarMode   = ENMultiBarMode.Clustered;
                bar.DataLabelStyle = new NDataLabelStyle(false);
                bar.ValueFormatter = new NNumericValueFormatter("0.###");
                chart.Series.Add(bar);

                for (int j = 0; j < 6; j++)
                {
                    bar.DataPoints.Add(new NBarDataPoint(random.Next(10, 100)));
                }
            }

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
		public override void LoadView ()
		{
			// Create a chart view that will display the chart.
			m_view = new NChartView ();

			// Paste your license key here.
			m_view.Chart.LicenseKey = "";

			// Switch on antialiasing.
			m_view.Chart.ShouldAntialias = true;

			// Margin to ensure some free space for the iOS status bar.
			m_view.Chart.CartesianSystem.Margin = new NChartMargin (10.0f, 10.0f, 10.0f, 20.0f);

			// Set data source for X-Axis.
			m_view.Chart.CartesianSystem.XAxis.DataSource = this;

			// Create series that will be displayed on the chart.
			NChartAreaSeries series = new NChartAreaSeries ();

			// Set brush that will fill that series with color.
			series.Brush = NChartSolidColorBrush.SolidColorBrushWithColor (UIColor.FromRGBA (0.38f, 0.8f, 0.91f, 0.9f));

			// Set data source for the series.
			series.DataSource = this;

			// Set data smoother.
			series.DataSmoother = NChartDataSmoother2D.DataSmoother;

			// Add series to the chart.
			m_view.Chart.AddSeries (series);

			// Update data in the chart.
			m_view.Chart.UpdateData ();

			// Set chart view to the controller.
			this.View = m_view;

			// Uncomment this line to get the animated transition.
			//m_view.Chart.PlayTransition(1.0f, false);
		}
Ejemplo n.º 18
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Axis Labels Formatting";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // add interlace stripe
            NLinearScale linearScale = m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale as NLinearScale;
            NScaleStrip  strip       = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;
            //linearScale.Strips.Add(strip);

            // setup a bar series
            NBarSeries bar = new NBarSeries();

            bar.Name           = "Bar Series";
            bar.InflateMargins = true;
            bar.UseXValues     = false;
            bar.DataLabelStyle = new NDataLabelStyle(false);

            // add some data to the bar series
            bar.LegendView.Mode = ENSeriesLegendMode.DataPoints;
            bar.DataPoints.Add(new NBarDataPoint(18, "C++"));
            bar.DataPoints.Add(new NBarDataPoint(15, "Ruby"));
            bar.DataPoints.Add(new NBarDataPoint(21, "Python"));
            bar.DataPoints.Add(new NBarDataPoint(23, "Java"));
            bar.DataPoints.Add(new NBarDataPoint(27, "Javascript"));
            bar.DataPoints.Add(new NBarDataPoint(29, "C#"));
            bar.DataPoints.Add(new NBarDataPoint(26, "PHP"));

            m_Chart.Series.Add(bar);

            return(chartView);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Axis Docking Percentages";

            NCartesianChart chart = (NCartesianChart)chartView.Surface.Charts[0];

            m_RedAxis = CreateLinearAxis(ENCartesianAxisDockZone.Left, NColor.Red);
            chart.Axes.Add(m_RedAxis);

            m_GreenAxis = CreateLinearAxis(ENCartesianAxisDockZone.Right, NColor.Green);
            chart.Axes.Add(m_GreenAxis);

            // Add a custom vertical axis
            m_BlueAxis = CreateLinearAxis(ENCartesianAxisDockZone.Left, NColor.Blue);
            chart.Axes.Add(m_BlueAxis);

            chart.Axes.Add(NCartesianChart.CreateDockedAxis(ENCartesianAxisDockZone.Bottom, ENScaleType.Orindal));

            // create three line series and dispay them on three vertical axes (red, green and blue axis)
            NLineSeries line1 = CreateLineSeries(NColor.Red, NColor.DarkRed, 10, 20);

            chart.Series.Add(line1);

            NLineSeries line2 = CreateLineSeries(NColor.Green, NColor.DarkGreen, 50, 100);

            chart.Series.Add(line2);

            NLineSeries line3 = CreateLineSeries(NColor.Blue, NColor.DarkBlue, 100, 200);

            chart.Series.Add(line3);

            line1.VerticalAxis = m_RedAxis;
            line2.VerticalAxis = m_GreenAxis;
            line3.VerticalAxis = m_BlueAxis;

            return(chartView);
        }
Ejemplo n.º 20
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Real Time Bar";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XYLinear);

            NLinearScale scaleY = (NLinearScale)m_Chart.Axes[ENCartesianAxis.PrimaryX].Scale;

            scaleY.InflateViewRangeBegin = false;
            scaleY.InflateViewRangeEnd   = false;

            // add interlaced stripe to the Y axis
            NScaleStrip strip = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;
            m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale.Strips.Add(strip);

            m_Random = new Random();

            m_Bar                = new NBarSeries();
            m_Bar.Name           = "Line Series";
            m_Bar.InflateMargins = true;
            m_Bar.DataLabelStyle = new NDataLabelStyle(false);
            m_Bar.UseXValues     = true;
            m_Bar.WidthMode      = ENBarWidthMode.ScaleWidth;
            m_Bar.Width          = 0.5;
            m_CurXValue          = 0;

            m_Chart.Series.Add(m_Bar);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
Ejemplo n.º 21
0
        public override void LoadView()
        {
            // Create a chart view that will display the chart.
            m_view = new NChartView();

            // Paste your license key here.
            m_view.Chart.LicenseKey = "";

            // Margin to ensure some free space for the iOS status bar.
            m_view.Chart.CartesianSystem.Margin = new NChartMargin(10.0f, 10.0f, 10.0f, 20.0f);

            // Create series that will be displayed on the chart.
            NChartColumnSeries series = new NChartColumnSeries();

            // Set brush that will fill that series with color.
            series.Brush = new NChartSolidColorBrush(UIColor.FromRGBA(97, 206, 231, 255));

            // Set data source for the series.
            series.DataSource = this;

            // Add series to the chart.
            m_view.Chart.AddSeries(series);

            // Activate streaming mode.
            m_view.Chart.StreamingMode = true;

            // Prevent minimum and maximum on the axes from "jumping" by activating incremental mode. So the minimum will remain
            // the minimal value ever appeared in the data, and maximum will remain the maximal one.
            m_view.Chart.IncrementalMinMaxMode = true;

            // Update data in the chart.
            m_view.Chart.UpdateData();

            // Set chart view to the controller.
            this.View = m_view;

            TimerCallback timerCallback = new TimerCallback(stream);

            m_timer = new Timer(timerCallback, m_view.Chart.Series()[m_view.Chart.Series().Length - 1], 100, 100);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Hierarchical Scale";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            // configure axes
            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // add the first bar
            m_Bar1 = new NBarSeries();
            m_Chart.Series.Add(m_Bar1);
            m_Bar1.Name           = "Coca Cola";
            m_Bar1.MultiBarMode   = ENMultiBarMode.Series;
            m_Bar1.DataLabelStyle = new NDataLabelStyle(false);

            // add the second bar
            m_Bar2 = new NBarSeries();
            m_Chart.Series.Add(m_Bar2);
            m_Bar2.Name           = "Pepsi";
            m_Bar2.MultiBarMode   = ENMultiBarMode.Clustered;
            m_Bar2.DataLabelStyle = new NDataLabelStyle(false);

            // add custom labels to the Y axis
            NLinearScale linearScale = (NLinearScale)m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale;

            // add interlace stripe
            NScaleStrip stripStyle = new NScaleStrip(new NColorFill(NColor.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            linearScale.Strips.Add(stripStyle);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
		public override void LoadView ()
		{
			// Create a chart view that will display the chart.
			m_view = new NChartView ();

			// Paste your license key here.
			m_view.Chart.LicenseKey = "";

			// Switch on antialiasing.
			m_view.Chart.ShouldAntialias = true;

			// Margin to ensure some free space for the iOS status bar.
			m_view.Chart.CartesianSystem.Margin = new NChartMargin (10.0f, 10.0f, 10.0f, 20.0f);

			// Switch 3D on. We will have a kind of fake 3D, because the Z-Axis will have no values. Just the columns will be
			// volumetric.
			m_view.Chart.DrawIn3D = true;

			// Set the data source for the X- and Z-Axis, because we want custom values on them.
			m_view.Chart.CartesianSystem.XAxis.DataSource = this;
			m_view.Chart.CartesianSystem.ZAxis.DataSource = this;

			// Create series that will be displayed on the chart.
			NChartColumnSeries series = new NChartColumnSeries ();

			// Set brush that will fill that series with color.
			series.Brush = NChartSolidColorBrush.SolidColorBrushWithColor (UIColor.FromRGBA (97, 206, 231, 255));

			// Set data source for the series.
			series.DataSource = this;

			// Add series to the chart.
			m_view.Chart.AddSeries (series);

			// Update data in the chart.
			m_view.Chart.UpdateData ();

			// Set chart view to the controller.
			this.View = m_view;
		}
Ejemplo n.º 24
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "XY Scatter Bar";

            // configure chart
            NCartesianChart chart = (NCartesianChart)chartView.Surface.Charts[0];

            chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XYLinear);

            // add interlaced stripe to the Y axis
            NScaleStrip stripStyle = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            chart.Axes[ENCartesianAxis.PrimaryY].Scale.Strips.Add(stripStyle);

            m_Bar = new NBarSeries();
            chart.Series.Add(m_Bar);

            m_Bar.DataLabelStyle = new NDataLabelStyle(false);
            m_Bar.InflateMargins = true;
            m_Bar.WidthMode      = ENBarWidthMode.FixedWidth;
            m_Bar.Width          = 20;

            m_Bar.Name       = "Bar Series";
            m_Bar.UseXValues = true;

            // add xy values
            m_Bar.DataPoints.Add(new NBarDataPoint(15, 10));
            m_Bar.DataPoints.Add(new NBarDataPoint(25, 23));
            m_Bar.DataPoints.Add(new NBarDataPoint(45, 12));
            m_Bar.DataPoints.Add(new NBarDataPoint(55, 21));
            m_Bar.DataPoints.Add(new NBarDataPoint(61, 16));
            m_Bar.DataPoints.Add(new NBarDataPoint(67, 19));
            m_Bar.DataPoints.Add(new NBarDataPoint(72, 11));

            return(chartView);
        }
        public override void LoadView()
        {
            // Create a chart view that will display the chart.
            m_view = new NChartView();

            // Paste your license key here.
            m_view.Chart.LicenseKey = "";

            // Switch on antialiasing.
            m_view.Chart.ShouldAntialias = true;

            // Margin to ensure some free space for the iOS status bar.
            m_view.Chart.CartesianSystem.Margin = new NChartMargin(10.0f, 10.0f, 10.0f, 20.0f);

            // Switch 3D on. We will have a kind of fake 3D, because the Z-Axis will have no values. Just the columns will be
            // volumetric.
            m_view.Chart.DrawIn3D = true;

            // Set the data source for the X- and Z-Axis, because we want custom values on them.
            m_view.Chart.CartesianSystem.XAxis.DataSource = this;
            m_view.Chart.CartesianSystem.ZAxis.DataSource = this;

            // Create series that will be displayed on the chart.
            NChartColumnSeries series = new NChartColumnSeries();

            // Set brush that will fill that series with color.
            series.Brush = new NChartSolidColorBrush(UIColor.FromRGBA(97, 206, 231, 255));

            // Set data source for the series.
            series.DataSource = this;

            // Add series to the chart.
            m_view.Chart.AddSeries(series);

            // Update data in the chart.
            m_view.Chart.UpdateData();

            // Set chart view to the controller.
            this.View = m_view;
        }
        public override void LoadView()
        {
            // Create a chart view that will display the chart.
            m_view = new NChartView();

            // Paste your license key here.
            m_view.Chart.LicenseKey = "";

            // Margin to ensure some free space for the iOS status bar.
            m_view.Chart.CartesianSystem.Margin = new NChartMargin(10.0f, 10.0f, 10.0f, 20.0f);

            // Create line series that will be displayed on the chart.
            NChartLineSeries series = new NChartLineSeries();

            // Set brush that will fill that series with color.
            series.Brush = new NChartSolidColorBrush(UIColor.FromRGB(0.38f, 0.8f, 0.91f));

            // Take control over marker's size.
            m_view.Chart.SizeAxis.DataSource = this;

            // Set data source for the series.
            series.DataSource = this;

            // Switch off the offset on the X-Axis, which is on by default.
            m_view.Chart.CartesianSystem.XAxis.HasOffset = false;

            // Add series to the chart.
            m_view.Chart.AddSeries(series);

            // Update data in the chart.
            m_view.Chart.UpdateData();

            // Set chart view to the controller.
            this.View = m_view;

            TimerCallback timerCallback = new TimerCallback(ChangeColor);

            m_timer = new Timer(timerCallback, m_view.Chart.Series()[m_view.Chart.Series().Length - 1], 0, 1000 / 30);
        }
Ejemplo n.º 27
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreatePieChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Tooltips";

            // configure chart
            m_PieChart = (NPieChart)chartView.Surface.Charts[0];

            m_PieSeries = new NPieSeries();
            m_PieChart.Series.Add(m_PieSeries);
            m_PieChart.DockSpiderLabelsToSides = true;

            NDataLabelStyle dataLabelStyle = new NDataLabelStyle();

            dataLabelStyle.ArrowLength        = 15;
            dataLabelStyle.ArrowPointerLength = 0;
            m_PieSeries.DataLabelStyle        = dataLabelStyle;

            m_PieSeries.LabelMode         = ENPieLabelMode.Spider;
            m_PieSeries.LegendView.Mode   = ENSeriesLegendMode.DataPoints;
            m_PieSeries.LegendView.Format = "<label> <percent>";

            m_PieSeries.DataPoints.Add(CreateDataPoint(24, "Cars"));
            m_PieSeries.DataPoints.Add(CreateDataPoint(18, "Airplanes"));
            m_PieSeries.DataPoints.Add(CreateDataPoint(32, "Trains"));
            m_PieSeries.DataPoints.Add(CreateDataPoint(23, "Ships"));
            m_PieSeries.DataPoints.Add(CreateDataPoint(19, "Buses"));



            // detach airplanes
            m_PieSeries.DataPoints[1].DetachmentPercent = 10;

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, true));

            return(chartView);
        }
Ejemplo n.º 28
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateFunnelChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Standard Funnel";

            NFunnelChart funnelChart = (NFunnelChart)chartView.Surface.Charts[0];

            m_FunnelSeries = new NFunnelSeries();
            funnelChart.Series.Add(m_FunnelSeries);

            m_FunnelSeries.DataPoints.Add(new NFunnelDataPoint(20.0, "Awareness"));
            m_FunnelSeries.DataPoints.Add(new NFunnelDataPoint(10.0, "First Hear"));
            m_FunnelSeries.DataPoints.Add(new NFunnelDataPoint(15.0, "Further Learn"));
            m_FunnelSeries.DataPoints.Add(new NFunnelDataPoint(7.0, "Liking"));
            m_FunnelSeries.DataPoints.Add(new NFunnelDataPoint(28.0, "Decision"));

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, true));

            return(chartView);
        }
Ejemplo n.º 29
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Standard Error Bar";

            // configure chart
            NCartesianChart chart = (NCartesianChart)chartView.Surface.Charts[0];

            chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XYLinear);

            // add interlace stripe
            NScaleStrip stripStyle = new NScaleStrip(new NColorFill(NColor.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            chart.Axes[ENCartesianAxis.PrimaryY].Scale.Strips.Add(stripStyle);
            chart.Axes[ENCartesianAxis.PrimaryY].Scale.MajorGridLines.Visible = true;

            chart.Axes[ENCartesianAxis.PrimaryY].Scale.ViewRangeInflateMode  = ENScaleViewRangeInflateMode.MajorTick;
            chart.Axes[ENCartesianAxis.PrimaryY].Scale.InflateViewRangeBegin = true;
            chart.Axes[ENCartesianAxis.PrimaryY].Scale.InflateViewRangeEnd   = true;
            chart.Axes[ENCartesianAxis.PrimaryX].Scale.ViewRangeInflateMode  = ENScaleViewRangeInflateMode.MajorTick;
            chart.Axes[ENCartesianAxis.PrimaryX].Scale.InflateViewRangeBegin = true;
            chart.Axes[ENCartesianAxis.PrimaryX].Scale.InflateViewRangeEnd   = true;

            // add an error bar series
            m_ErrorBar = new NErrorBarSeries();
            chart.Series.Add(m_ErrorBar);
            m_ErrorBar.DataLabelStyle = new NDataLabelStyle(false);
            m_ErrorBar.Stroke         = new NStroke(NColor.Black);
            m_ErrorBar.UseXValues     = true;

            GenerateData();

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
		public override void LoadView ()
		{
			// Create a chart view that will display the chart.
			m_view = new NChartView ();

			// Paste your license key here.
			m_view.Chart.LicenseKey = "";

			// Margin to ensure some free space for the iOS status bar.
			m_view.Chart.CartesianSystem.Margin = new NChartMargin (10.0f, 10.0f, 10.0f, 20.0f);

			// Create series that will be displayed on the chart.
			NChartColumnSeries series = new NChartColumnSeries ();

			// Set brush that will fill that series with color.
			series.Brush = NChartSolidColorBrush.SolidColorBrushWithColor (UIColor.FromRGBA (97, 206, 231, 255));

			// Set data source for the series.
			series.DataSource = this;

			// Add series to the chart.
			m_view.Chart.AddSeries (series);

			// Activate streaming mode.
			m_view.Chart.StreamingMode = true;

			// Prevent minimum and maximum on the axes from "jumping" by activating incremental mode. So the minimum will remain
			// the minimal value ever appeared in the data, and maximum will remain the maximal one.
			m_view.Chart.IncrementalMinMaxMode = true;

			// Update data in the chart.
			m_view.Chart.UpdateData ();

			// Set chart view to the controller.
			this.View = m_view;

			TimerCallback timerCallback = new TimerCallback (stream);
			m_timer = new Timer (timerCallback, m_view.Chart.Series [m_view.Chart.Series.Length - 1], 100, 100);
		}
Ejemplo n.º 31
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Renko";

            // configure chart
            NCartesianChart chart = (NCartesianChart)chartView.Surface.Charts[0];

            chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XYLinear);

            NLinearScale scaleY = (NLinearScale)chart.Axes[ENCartesianAxis.PrimaryY].Scale;

            // add interlace stripe
            NScaleStrip stripStyle = new NScaleStrip(new NColorFill(NColor.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            scaleY.Strips.Add(stripStyle);

            // setup X axis
            NPriceTimeScale priceScale = new NPriceTimeScale();

            priceScale.InnerMajorTicks.Stroke          = new NStroke(0.0, NColor.Black);
            chart.Axes[ENCartesianAxis.PrimaryX].Scale = priceScale;

            // setup line break series
            m_RenkoSeries            = new NRenkoSeries();
            m_RenkoSeries.BoxSize    = 1;
            m_RenkoSeries.UseXValues = true;
            chart.Series.Add(m_RenkoSeries);

            GenerateData(m_RenkoSeries);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
Ejemplo n.º 32
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Smooth Line";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // add interlaced stripe to the Y axis
            NScaleStrip strip = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;
            m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale.Strips.Add(strip);

            m_Line                 = new NLineSeries();
            m_Line.Name            = "Line Series";
            m_Line.InflateMargins  = true;
            m_Line.DataLabelStyle  = new NDataLabelStyle("<value>");
            m_Line.MarkerStyle     = new NMarkerStyle(new NSize(4, 4));
            m_Line.LineSegmentMode = ENLineSegmentMode.Spline;

            Random random = new Random();

            for (int i = 0; i < 8; i++)
            {
                m_Line.DataPoints.Add(new NLineDataPoint(random.Next(80) + 20));
            }

            m_Chart.Series.Add(m_Line);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
		public override void LoadView ()
		{
			// Create a chart view that will display the chart.
			m_view = new NChartView ();

			// Paste your license key here.
			m_view.Chart.LicenseKey = "";

			// Switch this field to view all types of series.
			type = SeriesType.Column2D;

			// Switch on antialiasing.
			m_view.Chart.ShouldAntialias = true;

			if (type >= SeriesType.Column3D) {
				// Switch 3D on.
				m_view.Chart.DrawIn3D = true;
				// Margin to ensure some free space for the iOS status bar and Y-Axis tick titles.
				m_view.Chart.CartesianSystem.Margin = new NChartMargin (50.0f, 50.0f, 10.0f, 20.0f);
				m_view.Chart.PolarSystem.Margin = new NChartMargin (50.0f, 50.0f, 10.0f, 20.0f);
			} else {
				// Margin to ensure some free space for the iOS status bar.
				m_view.Chart.CartesianSystem.Margin = new NChartMargin (10.0f, 10.0f, 10.0f, 20.0f);
				m_view.Chart.PolarSystem.Margin = new NChartMargin (10.0f, 10.0f, 10.0f, 20.0f);
			}

			// Set data source for the size axis to provide sizes for bubbles.
			m_view.Chart.SizeAxis.DataSource = this;

			// Create series that will be displayed on the chart.
			CreateSeries ();

			// Update data in the chart.
			m_view.Chart.UpdateData ();

			// Set chart view to the controller.
			this.View = m_view;
		}
        public override void LoadView()
        {
            // Create a chart view that will display the chart.
            m_view = new NChartView();

            // Paste your license key here.
            m_view.Chart.LicenseKey = "";

            // Set the data source for X-Axis to perform custom date to string conversion.
            m_view.Chart.CartesianSystem.XAxis.DataSource = this;

            // Turn on the date time mode of X-Axis.
            m_view.Chart.CartesianSystem.XAxis.HasDates = true;

            // Margin to ensure some free space for the iOS status bar.
            m_view.Chart.CartesianSystem.Margin = new NChartMargin(10.0f, 10.0f, 10.0f, 20.0f);

            // Create series that will be displayed on the chart.
            NChartColumnSeries series = new NChartColumnSeries();

            // Set brush that will fill that series with color.
            series.Brush = new NChartSolidColorBrush(UIColor.FromRGBA(97, 206, 231, 255));

            // Set data source for the series.
            series.DataSource = this;

            // Add series to the chart.
            m_view.Chart.AddSeries(series);

            // Update data in the chart.
            m_view.Chart.UpdateData();

            // Calculate optimal tick spacing to display dates avoiding overlapping.
            m_view.Chart.CartesianSystem.XAxis.CalcOptimalMinTickSpacing();

            // Set chart view to the controller.
            this.View = m_view;
        }
Ejemplo n.º 35
0
        public override void LoadView()
        {
            // Create a chart view that will display the chart.
            m_view = new NChartView();

            // Paste your license key here.
            m_view.Chart.LicenseKey = "";

            // Switch on antialiasing.
            m_view.Chart.ShouldAntialias = true;

            // Margin to ensure some free space for the iOS status bar.
            m_view.Chart.CartesianSystem.Margin = new NChartMargin(10.0f, 10.0f, 10.0f, 20.0f);
            m_view.Chart.PolarSystem.Margin     = new NChartMargin(10.0f, 10.0f, 10.0f, 20.0f);

            // Create series that will be displayed on the chart.
            NChartHeatmapSeries series = new NChartHeatmapSeries();

            series.DataSource = this;
            series.Tag        = 0;

            // Create brush scale.
            // See NChartBrushScale for details.
            series.Scale = NChartBrushScale.BrushScaleWithBrushes(brushes, new NSNumber[] {
                NSNumber.FromDouble(-0.3),
                NSNumber.FromDouble(0.3)
            });

            m_view.Chart.AddSeries(series);
            m_view.Chart.CartesianSystem.XAxis.ShouldBeautifyMinAndMax = false;
            m_view.Chart.CartesianSystem.YAxis.ShouldBeautifyMinAndMax = false;

            // Update data in the chart.
            m_view.Chart.UpdateData();

            // Set chart view to the controller.
            this.View = m_view;
        }
		public override void LoadView ()
		{
			// Create a chart view that will display the chart.
			m_view = new NChartView ();

			// Paste your license key here.
			m_view.Chart.LicenseKey = "";

			// Margin to ensure some free space for the iOS status bar.
			m_view.Chart.CartesianSystem.Margin = new NChartMargin (10.0f, 10.0f, 10.0f, 20.0f);

			// Create line series that will be displayed on the chart.
			NChartLineSeries series = new NChartLineSeries ();

			// Set brush that will fill that series with color.
			series.Brush = NChartSolidColorBrush.SolidColorBrushWithColor (UIColor.FromRGB (0.38f, 0.8f, 0.91f));

			// Take control over marker's size.
			m_view.Chart.SizeAxis.DataSource = this;

			// Set data source for the series.
			series.DataSource = this;

			// Switch off the offset on the X-Axis, which is on by default.
			m_view.Chart.CartesianSystem.XAxis.HasOffset = false;

			// Add series to the chart.
			m_view.Chart.AddSeries (series);

			// Update data in the chart.
			m_view.Chart.UpdateData ();

			// Set chart view to the controller.
			this.View = m_view;

			TimerCallback timerCallback = new TimerCallback (ChangeColor);
			m_timer = new Timer (timerCallback, m_view.Chart.Series [m_view.Chart.Series.Length - 1], 0, 1000 / 30);
		}
Ejemplo n.º 37
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Stacked Line";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // add interlaced stripe to the Y axis
            NScaleStrip stripStyle = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale.Strips.Add(stripStyle);

            // add the first line
            m_Line1 = CreateLineSeries("Line 1", ENMultiLineMode.Series);
            m_Line1.LegendView.Mode = ENSeriesLegendMode.SeriesVisibility;
            m_Chart.Series.Add(m_Line1);

            // add the second line
            m_Line2 = CreateLineSeries("Line 2", ENMultiLineMode.Stacked);
            m_Line2.LegendView.Mode = ENSeriesLegendMode.SeriesVisibility;
            m_Chart.Series.Add(m_Line2);

            // add the third line
            m_Line3 = CreateLineSeries("Line 3", ENMultiLineMode.Stacked);
            m_Line3.LegendView.Mode = ENSeriesLegendMode.SeriesVisibility;
            m_Chart.Series.Add(m_Line3);

            // positive data
            OnPositiveDataButtonClick(null);

            return(chartView);
        }
Ejemplo n.º 38
0
        public override void LoadView()
        {
            // Create a chart view that will display the chart.
            m_view = new NChartView();

            // Paste your license key here.
            m_view.Chart.LicenseKey = "";

            // Switch on antialiasing.
            m_view.Chart.ShouldAntialias = true;

            // Margin to ensure some free space for the iOS status bar.
            m_view.Chart.CartesianSystem.Margin = new NChartMargin(10.0f, 10.0f, 10.0f, 20.0f);
            m_view.Chart.PolarSystem.Margin     = new NChartMargin(10.0f, 10.0f, 10.0f, 20.0f);

            // Create series that will be displayed on the chart.
            NChartBandSeries series = new NChartBandSeries();

            series.DataSource      = this;
            series.Tag             = 0;
            series.PositiveColor   = UIColor.FromRGBA(112, 170, 242, 204);
            series.NegativeColor   = UIColor.FromRGBA(196, 240, 91, 204);
            series.HighBorderColor = UIColor.FromRGB(130, 196, 255);
            series.LowBorderColor  = UIColor.FromRGB(226, 255, 112);
            series.BorderThickness = 5.0f;
            m_view.Chart.AddSeries(series);

            m_view.Chart.CartesianSystem.XAxis.HasOffset = true;
            m_view.Chart.CartesianSystem.YAxis.HasOffset = false;
            m_view.Chart.CartesianSystem.ZAxis.HasOffset = true;

            // Update data in the chart.
            m_view.Chart.UpdateData();

            // Set chart view to the controller.
            this.View = m_view;
        }
Ejemplo n.º 39
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Standard High Low";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XYLinear);

            // add interlace stripe
            NLinearScale linearScale = m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale as NLinearScale;
            NScaleStrip  strip       = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;

            m_HighLow                = new NHighLowSeries();
            m_HighLow.Name           = "High-Low Series";
            m_HighLow.HighFill       = new NColorFill(NColor.Gray);
            m_HighLow.LowFill        = new NColorFill(NColor.Orange);
            m_HighLow.HighStroke     = new NStroke(2, NColor.Black);
            m_HighLow.LowStroke      = new NStroke(2, NColor.Red);
            m_HighLow.Stroke         = new NStroke(2, NColor.Black);
            m_HighLow.DataLabelStyle = new NDataLabelStyle(false);
            m_HighLow.Palette        = new NTwoColorPalette(NColor.Red, NColor.Green);

            GenerateData();

            m_Chart.Series.Add(m_HighLow);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
Ejemplo n.º 40
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Contour Chart";

            // configure chart
            NCartesianChart chart = (NCartesianChart)chartView.Surface.Charts[0];

            chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XYLinear);

            m_HeatMap = new NHeatMapSeries();
            chart.Series.Add(m_HeatMap);

            m_HeatMap.Palette = new NColorValuePalette(new NColorValuePair[] { new NColorValuePair(0.0, NColor.Purple),
                                                                               new NColorValuePair(1.5, NColor.MediumSlateBlue),
                                                                               new NColorValuePair(3.0, NColor.CornflowerBlue),
                                                                               new NColorValuePair(4.5, NColor.LimeGreen),
                                                                               new NColorValuePair(6.0, NColor.LightGreen),
                                                                               new NColorValuePair(7.5, NColor.Yellow),
                                                                               new NColorValuePair(9.0, NColor.Orange),
                                                                               new NColorValuePair(10.5, NColor.Red) });

/*			m_HeatMap.Palette = new NColorValuePalette(new NColorValuePair[] { new NColorValuePair(-5.0, NColor.Purple),
 *                                                      new NColorValuePair(1, NColor.MediumSlateBlue),
 *                                                      new NColorValuePair(10.0, NColor.CornflowerBlue) });*/

            m_HeatMap.ContourDisplayMode = ENContourDisplayMode.Contour;
            m_HeatMap.LegendView.Mode    = ENSeriesLegendMode.SeriesLogic;
            m_HeatMap.LegendView.Format  = "<level_value>";

            GenerateData();

            return(chartView);
        }
		public override void LoadView ()
		{
			// Create a chart view that will display the chart.
			m_view = new NChartView ();

			// Paste your license key here.
			m_view.Chart.LicenseKey = "";

			// Switch on antialiasing.
			m_view.Chart.ShouldAntialias = true;

			// Margin to ensure some free space for the iOS status bar.
			m_view.Chart.CartesianSystem.Margin = new NChartMargin (10.0f, 10.0f, 10.0f, 20.0f);

			// Set up the time axis.
			m_view.Chart.TimeAxis.TickShape = NChartTimeAxisTickShape.Line;
			m_view.Chart.TimeAxis.TickTitlesFont = UIFont.BoldSystemFontOfSize (11.0f);
			m_view.Chart.TimeAxis.TickTitlesLayout = NChartTimeAxisLabelsLayout.ShowFirstLastLabelsOnly;
			m_view.Chart.TimeAxis.TickTitlesPosition = NChartTimeAxisLabelsPosition.Beneath;
			m_view.Chart.TimeAxis.TickTitlesColor = UIColor.FromRGB (140, 140, 140);
			m_view.Chart.TimeAxis.TickColor = UIColor.FromRGB (110, 110, 110);
			m_view.Chart.TimeAxis.Margin = new NChartMargin (20.0f, 20.0f, 10.0f, 0.0f);
			m_view.Chart.TimeAxis.AutohideTooltip = false;

			// Create the time axis tooltip.
			m_view.Chart.TimeAxis.Tooltip = new NChartTimeAxisTooltip ();
			m_view.Chart.TimeAxis.Tooltip.TextColor = UIColor.FromRGB (140, 140, 140);
			m_view.Chart.TimeAxis.Tooltip.Font = UIFont.SystemFontOfSize (11.0f);

			// Set images for the time axis.
			setImagesForTimeAxis (
				"slider-light.png",
				"handler-light.png",
				"play-light.png",
				"play-pushed-light.png",
				"pause-light.png",
				"pause-pushed-light.png"
			);

			// Visible time axis.
			m_view.Chart.TimeAxis.Visible = true;

			// Set animation time in seconds.
			m_view.Chart.TimeAxis.AnimationTime = 3.0f;

			// Switch 3D on.
			m_view.Chart.DrawIn3D = true;

			// Switch on antialiasing.
			m_view.Chart.ShouldAntialias = true;

			// Create series.
			for (int i = 0; i < 3; ++i) {
				NChartBubbleSeries series = new NChartBubbleSeries ();
				series.DataSource = this;
				series.Tag = i;
				// Add series to the chart.
				m_view.Chart.AddSeries (series);
			}
			m_view.Chart.CartesianSystem.XAxis.HasOffset = false;
			m_view.Chart.CartesianSystem.YAxis.HasOffset = false;
			m_view.Chart.CartesianSystem.ZAxis.HasOffset = false;

			// Set data source for the size axis to provide ticks.
			m_view.Chart.TimeAxis.DataSource = this;

			// Set data source for the size axis to provide sizes for bubbles.
			m_view.Chart.SizeAxis.DataSource = this;

			// Reset animation.
			m_view.Chart.TimeAxis.Stop ();
			m_view.Chart.TimeAxis.GoToFirstTick ();

			// Update data in the chart.
			m_view.Chart.UpdateData ();

			// Set chart view to the controller.
			this.View = m_view;
		}