示例#1
0
 public NChartPoint[] Points(NChartSeries series)
 {
     // Create points with some data for the series.
     NChartPoint[] result = new NChartPoint[1];
     result[0] = new NChartPoint(NChartPointState.PointStateWithCircleValue(0, random.Next(30) + 1), series);
     return(result);
 }
 public NChartPoint [] Points(NChartSeries series)
 {
     // Create points with some data for the series.
     NChartPoint[] result = new NChartPoint[3];
     for (int i = 0; i < 3; ++i)
     {
         NChartPointState[] states = new NChartPointState[3];
         for (int j = 0; j < 3; ++j)
         {
             NChartPointState state = NChartPointState.PointStateWithXYZ(
                 (m_rand.Next() % 10) + 1,
                 (m_rand.Next() % 10) + 1,
                 (m_rand.Next() % 10) + 1
                 );
             state.Marker       = new NChartMarker();
             state.Marker.Size  = (float)(m_rand.Next() % 1000) / 1000.0f;
             state.Marker.Brush = brushes[series.Tag];
             state.Marker.Shape = NChartMarkerShape.Sphere;
             state.Marker.Brush.ShadingModel = NChartShadingModel.Phong;
             states[j] = state;
         }
         result[i] = new NChartPoint(states, series);
     }
     return(result);
 }
示例#3
0
        public void PointSelected(NChart nChart, NChartPoint nChartPoint)
        {
            if (prevSelectedPoint != null)
            {
                prevSelectedPoint.Tooltip.SetVisibleAnimated(false, 0.25f);
            }

            if (nChartPoint != null)
            {
                if (nChartPoint.Tooltip != null)
                {
                    if (nChartPoint == prevSelectedPoint)
                    {
                        prevSelectedPoint = null;
                    }
                    else
                    {
                        prevSelectedPoint = nChartPoint;
                        UpdateTooltipText(nChartPoint);
                        nChartPoint.Tooltip.SetVisibleAnimated(true, 0.25f);
                    }
                }
                else
                {
                    prevSelectedPoint   = nChartPoint;
                    nChartPoint.Tooltip = CreateTooltip();
                    UpdateTooltipText(nChartPoint);
                    nChartPoint.Tooltip.SetVisibleAnimated(true, 0.25f);
                }
            }
            else
            {
                prevSelectedPoint = null;
            }
        }
示例#4
0
		public NChartPoint[] PointsForSeries (NChartSeries series)
		{
			NChartPoint[] result = new NChartPoint[5];
			for (int i = 0; i < 5; ++i)
				result [i] = new NChartPoint (NChartPointState.PointStateAlignedToXWithXY (i, random.Next (30) + 1), series);
			return result;
		}
示例#5
0
        public void PointSelected(NChart chart, NChartPoint point)
        {
            if (m_prevSelectedPoint != null && m_prevSelectedPoint.Tooltip != null)
            {
                m_prevSelectedPoint.Tooltip.SetVisibleAnimated(false, 0.25f);
            }

            if (point != null)
            {
                if (point.Tooltip != null)
                {
                    if (point == m_prevSelectedPoint)
                    {
                        m_prevSelectedPoint = null;
                    }
                    else
                    {
                        m_prevSelectedPoint = point;
                        UpdateTooltipText(point);
                        point.Tooltip.SetVisibleAnimated(true, 0.25f);
                    }
                }
                else
                {
                    m_prevSelectedPoint = point;
                    point.Tooltip       = CreateTooltip();
                    UpdateTooltipText(point);
                    point.Tooltip.SetVisibleAnimated(true, 0.25f);
                }
            }
            else
            {
                m_prevSelectedPoint = null;
            }
        }
示例#6
0
 public NChartPoint[] Points(NChartSeries series)
 {
     // Create points with some data for the series.
     NChartPoint[] result = new NChartPoint[1];
     result[0]         = new NChartPoint(NChartPointState.PointStateWithCircleValue(0, random.Next() % 30 + 1), series);
     result[0].Tooltip = CreateCallout(string.Format("Callout for series {0}", series.Tag + 1), series.Tag);
     return(result);
 }
示例#7
0
		public NChartPoint[] PointsForSeries (NChartSeries series)
		{
			// Create points with some data for the series.
			NChartPoint[] result = new NChartPoint[11];
			for (int i = 0; i <= 10; ++i)
				result [i] = new NChartPoint (NChartPointState.PointStateAlignedToXWithXY (i, random.Next (30) + 1), series);
			return result;
		}
示例#8
0
 public NChartPoint[] Points(NChartSeries series)
 {
     NChartPoint[] result = new NChartPoint[11];
     for (int i = 0; i <= 10; ++i)
     {
         result[i] = new NChartPoint(NChartPointState.PointStateAlignedToXWithXY(i, random.Next(30) + 1), series);
     }
     return(result);
 }
		public NChartPoint [] SeriesDataSourcePointsForSeries (NChartSeries series)
		{
			// Create points with some data for the series.
			NChartPoint[] result = new NChartPoint[1];

			result [0] = NChartPoint.PointWithState (NChartPointState.PointStateWithCircleValue (0, (m_rand.Next () % 30) + 1), series);

			return result;
		}
示例#10
0
 public NChartPoint[] Points(NChartSeries series)
 {
     NChartPoint[] result = new NChartPoint[10];
     for (int i = 0; i < 10; ++i)
     {
         int y = (random.Next(26) + 1) * (series.Tag == 2 ? 2 : 1);
         result [i] = new NChartPoint(NChartPointState.PointStateAlignedToXWithXY(i, y), series);
     }
     return(result);
 }
示例#11
0
        public void PointSelected(NChart chart, NChartPoint point)
        {
            // Disable highlight.
            if (m_prevSelectedPoint != null)
            {
                m_prevSelectedPoint.Highlight((int)NChartHighlightType.None, 0.25f, 0.0f);
            }

            if (point != null)
            {
                if (point == m_prevSelectedPoint)
                {
                    m_prevSelectedPoint = null;

                    // Return to normal zoom.
                    if (m_zoomed)
                    {
                        m_zoomed = false;
                        m_view.Chart.ZoomTo(1.0f, 0.25f, 0.0f);
                    }
                }
                else
                {
                    m_prevSelectedPoint = point;

                    if (!m_zoomed)
                    {
                        m_zoomed = true;
                        m_view.Chart.ZoomTo(0.85f, 0.25f, 0.0f);
                    }

                    // Set shift to highlight.
                    point.HighlightShift = 0.2f;

                    // Set color to highlight.
                    point.HighlightColor = UIColor.Red;

                    // Highlight point by shift and color.
                    point.Highlight((int)NChartHighlightType.Shift | (int)NChartHighlightType.Color, 0.25f, 0.0f);
                }
            }
            else
            {
                m_prevSelectedPoint = null;

                // Return to normal zoom.
                if (m_zoomed)
                {
                    m_zoomed = false;
                    m_view.Chart.ZoomTo(1.0f, 0.25f, 0.0f);
                }
            }
        }
示例#12
0
        public void PointSelected(NChart nChart, NChartPoint nChartPoint)
        {
            // Disable highlight.
            if (prevSelectedPoint != null)
            {
                prevSelectedPoint.Highlight(NChartHighlightType.None, 0.25f, 0.0f);
            }

            if (nChartPoint != null)
            {
                if (nChartPoint == prevSelectedPoint)
                {
                    prevSelectedPoint = null;

                    // Return to normal zoom.
                    if (zoomed)
                    {
                        zoomed = false;
                        mNChartView.Chart.ZoomTo(1.0f, 0.25f, 0.0f);
                    }
                }
                else
                {
                    prevSelectedPoint = nChartPoint;

                    if (!zoomed)
                    {
                        zoomed = true;
                        mNChartView.Chart.ZoomTo(0.85f, 0.25f, 0.0f);
                    }

                    // Set shift to highlight.
                    nChartPoint.HighlightShift = 0.2f;

                    // Set color to highlight.
                    nChartPoint.HighlightColor = Color.Red;

                    // Highlight point by shift and color.
                    nChartPoint.Highlight(NChartHighlightType.Shift | NChartHighlightType.Color, 0.25f, 0.0f);
                }
            }
            else
            {
                prevSelectedPoint = null;

                // Return to normal zoom.
                if (zoomed)
                {
                    zoomed = false;
                    mNChartView.Chart.ZoomTo(1.0f, 0.25f, 0.0f);
                }
            }
        }
		public HighlightViewController () : base ()
		{
			m_zoomed = false;
			m_prevSelectedPoint = null;
			m_rand = new Random ();

			// Create brushes.
			brushes = new NChartSolidColorBrush[3];
			brushes [0] = NChartSolidColorBrush.SolidColorBrushWithColor (UIColor.FromRGB (97, 206, 231));
			brushes [1] = NChartSolidColorBrush.SolidColorBrushWithColor (UIColor.FromRGB (203, 220, 56));
			brushes [2] = NChartSolidColorBrush.SolidColorBrushWithColor (UIColor.FromRGB (229, 74, 131));
		}
示例#14
0
        public HighlightViewController() : base()
        {
            m_zoomed            = false;
            m_prevSelectedPoint = null;
            m_rand = new Random();

            // Create brushes.
            brushes     = new NChartSolidColorBrush[3];
            brushes [0] = new NChartSolidColorBrush(UIColor.FromRGB(97, 206, 231));
            brushes [1] = new NChartSolidColorBrush(UIColor.FromRGB(203, 220, 56));
            brushes [2] = new NChartSolidColorBrush(UIColor.FromRGB(229, 74, 131));
        }
示例#15
0
 public NChartPoint[] Points(NChartSeries series)
 {
     // Create points with some data for the series.
     NChartPoint[] result = new NChartPoint[10];
     for (int i = 0; i < 10; ++i)
     {
         NChartPointState[] states = new NChartPointState[3];
         for (int j = 0; j < 3; ++j)
         {
             states[j] = NChartPointState.PointStateWithXYZ(i, random.Next(30) + 1, 0);
         }
         result[i] = new NChartPoint(states, series);
     }
     return(result);
 }
示例#16
0
        public NChartPoint[] Points(NChartSeries series)
        {
            // Create chart points with dates by X-Axis.
            const int numberOfDays = 8;
            const int startDay     = 2;

            NChartPoint[] result = new NChartPoint[numberOfDays];
            Calendar      cal    = Calendar.Instance;

            cal.Set(CalendarField.Year, 2015);
            cal.Set(CalendarField.Month, 1);
            cal.Set(CalendarField.DayOfMonth, startDay);
            cal.Set(CalendarField.HourOfDay, 12);
            Date startDate = cal.Time;

            for (int i = 0; i < numberOfDays; ++i)
            {
                cal.Set(CalendarField.DayOfMonth, startDay + i);
                Date date = cal.Time;
                result[i] = new NChartPoint(NChartPointState.PointStateAlignedToXWithXY(date, random.Next(30) + 1), series);
            }
            return(result);
        }
		public void PointOfChartSelected (NChart chart, NChartPoint point)
		{
			if (m_prevSelectedPoint != null && m_prevSelectedPoint.Tooltip != null)
				m_prevSelectedPoint.Tooltip.SetVisible (false, 0.25f);

			if (point != null) {
				if (point.Tooltip != null) {
					if (point == m_prevSelectedPoint) {
						m_prevSelectedPoint = null;
					} else {
						m_prevSelectedPoint = point;
						UpdateTooltipText (point);
						point.Tooltip.SetVisible (true, 0.25f);
					}
				} else {
					m_prevSelectedPoint = point;
					point.Tooltip = CreateTooltip ();
					UpdateTooltipText (point);
					point.Tooltip.SetVisible (true, 0.25f);
				}
			} else {
				m_prevSelectedPoint = null;
			}
		}
		public NChartPoint [] SeriesDataSourcePointsForSeries (NChartSeries series)
		{
			// Create points with some data for the series.
			NChartPoint[] result = new NChartPoint[3];
			for (int i = 0; i < 3; ++i)
			{
				NChartPointState[] states = new NChartPointState[3];
				for (int j = 0; j < 3; ++j)
				{
					NChartPointState state = NChartPointState.PointStateWithXYZ (
						(m_rand.Next () % 10) + 1, 
						(m_rand.Next () % 10) + 1, 
						(m_rand.Next () % 10) + 1
					);
					state.Marker = new NChartMarker ();
					state.Marker.Size = (float)(m_rand.Next() % 1000) / 1000.0f;
					state.Marker.Brush = brushes[series.Tag];
					state.Marker.Shape = NChartMarkerShape.Sphere;
					state.Marker.Brush.ShadingModel = NChartShadingModel.Phong;
					states[j] = state;
				}
				result[i] = NChartPoint.PointWithArrayOfStates (states, series);
			}
			return result;
		}
示例#19
0
 public TooltipsViewController() : base()
 {
     m_prevSelectedPoint = null;
     m_rand = new Random();
 }
示例#20
0
 void UpdateTooltipText(NChartPoint point)
 {
     point.Tooltip.Text = "This is tooltip.";
 }
		public void PointOfChartSelected (NChart chart, NChartPoint point)
		{
			// Disable highlight.
			if (m_prevSelectedPoint != null)
				m_prevSelectedPoint.HighlightWithMask ((uint)NChartHighlightType.None, 0.25f, 0.0f);

			if (point != null) {
				if (point == m_prevSelectedPoint) {
					m_prevSelectedPoint = null;

					// Return to normal zoom.
					if (m_zoomed) {
						m_zoomed = false;
						m_view.Chart.ZoomTo (1.0f, 0.25f, 0.0f);
					}
				} else {
					m_prevSelectedPoint = point;

					if (!m_zoomed) {
						m_zoomed = true;
						m_view.Chart.ZoomTo (0.85f, 0.25f, 0.0f);
					}

					// Set shift to highlight.
					point.HighlightShift = 0.2f;

					// Set color to highlight.
					point.HighlightColor = UIColor.Red;

					// Highlight point by shift and color.
					point.HighlightWithMask ((uint)NChartHighlightType.Shift | (uint)NChartHighlightType.Color, 0.25f, 0.0f);
				}
			} else {
				m_prevSelectedPoint = null;

				// Return to normal zoom.
				if (m_zoomed) {
					m_zoomed = false;
					m_view.Chart.ZoomTo (1.0f, 0.25f, 0.0f);
				}
			}
		}
示例#22
0
		public NChartPoint[] PointsForSeries (NChartSeries series)
		{
			// Create points with some data for the series.
			NChartPoint[] result = new NChartPoint[3];
			for (int i = 0; i < 3; ++i) {
				NChartPointState[] states = new NChartPointState[3];
				for (int j = 0; j < 3; ++j) {
					NChartPointState state = NChartPointState.PointStateWithXYZ (
						random.Next (10) + 1, 
						random.Next (10) + 1, 
						random.Next (10) + 1);
					state.Marker = new NChartMarker ();
					state.Marker.Size = (float)random.NextDouble ();
					state.Marker.Brush = brushes [series.Tag];
					state.Marker.Shape = NChartTypes.MarkerShape.Sphere;
					state.Marker.Brush.ShadingModel = NChartTypes.ShadingModel.Phong;

					states [j] = state;
				}
				result [i] = new NChartPoint (states, series);
			}
			return result;
		}
		void UpdateTooltipText (NChartPoint point)
		{
			point.Tooltip.Text = "This is tooltip";
		}
示例#24
0
		public NChartPoint[] PointsForSeries (NChartSeries series)
		{
			// Create points with some data for the series.
			NChartPoint[] result = new NChartPoint[1];
			result [0] = new NChartPoint (NChartPointState.PointStateWithCircleValue (0, random.Next (30) + 1), series);
			return result;
		}
示例#25
0
		public void PointSelected (NChart nChart, NChartPoint nChartPoint)
		{
			if (prevSelectedPoint != null)
				prevSelectedPoint.Tooltip.SetVisibleAnimated (false, 0.25f);

			if (nChartPoint != null) {
				if (nChartPoint.Tooltip != null) {
					if (nChartPoint == prevSelectedPoint)
						prevSelectedPoint = null;
					else {
						prevSelectedPoint = nChartPoint;
						UpdateTooltipText (nChartPoint);
						nChartPoint.Tooltip.SetVisibleAnimated (true, 0.25f);
					}
				} else {
					prevSelectedPoint = nChartPoint;
					nChartPoint.Tooltip = CreateTooltip ();
					UpdateTooltipText (nChartPoint);
					nChartPoint.Tooltip.SetVisibleAnimated (true, 0.25f);
				}
			} else
				prevSelectedPoint = null;
		}
		public TooltipsViewController () : base ()
		{
			m_prevSelectedPoint = null;
			m_rand = new Random ();
		}
示例#27
0
		public void PointSelected (NChart nChart, NChartPoint nChartPoint)
		{
			// Disable highlight.
			if (prevSelectedPoint != null)
				prevSelectedPoint.Highlight (NChartTypes.HighlightType.None, 0.25f, 0.0f);

			if (nChartPoint != null) {
				if (nChartPoint == prevSelectedPoint) {
					prevSelectedPoint = null;

					// Return to normal zoom.
					if (zoomed) {
						zoomed = false;
						mNChartView.Chart.ZoomTo (1.0f, 0.25f, 0.0f);
					}
				} else {
					prevSelectedPoint = nChartPoint;

					if (!zoomed) {
						zoomed = true;
						mNChartView.Chart.ZoomTo (0.85f, 0.25f, 0.0f);
					}

					// Set shift to highlight.
					nChartPoint.HighlightShift = 0.2f;

					// Set color to highlight.
					nChartPoint.HighlightColor = Color.Red;

					// Highlight point by shift and color.
					nChartPoint.Highlight (NChartTypes.HighlightType.Shift | NChartTypes.HighlightType.Color, 0.25f, 0.0f);
				}
			} else {
				prevSelectedPoint = null;

				// Return to normal zoom.
				if (zoomed) {
					zoomed = false;
					mNChartView.Chart.ZoomTo (1.0f, 0.25f, 0.0f);
				}
			}
		}