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; }
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; }
public NChartPoint [] SeriesDataSourcePointsForSeries (NChartSeries series) { // Create points with some data for the series. List<NChartPoint> result = new List<NChartPoint> (); for (int i = 0; i < 5; ++i) result.Add (NChartPoint.PointWithState (NChartPointState.PointStateAlignedToXZWithXYZ (i, m_rand.Next () % 30 + 1, 0), series)); return result.ToArray (); }
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; }
public NChartPoint [] SeriesDataSourcePointsForSeries (NChartSeries series) { // Create points with some data for the series. List<NChartPoint> result = new List<NChartPoint> (); for (int i = 0; i < 10; ++i) result.Add (NChartPoint.PointWithState (NChartPointState.PointStateAlignedToXWithXY ( i, ((m_rand.Next () % 30) + 1) * (series.Tag == 2 ? 2 : 1) ), series)); return result.ToArray (); }
public string NameForSeries (NChartSeries series) { return string.Format ("My series {0}", series.Tag); }
public NChartPoint [] SeriesDataSourcePointsForSeries (NChartSeries series) { // Create points for series as seen on the picture. A bit wired logic: we double the points in the middle of // line to have individual segments. This will help us to achieve the effect of floating color. Also we calculate // the length of the line. FloatingColorViewController.m_length = 0.0; List<NChartPoint> result = new List<NChartPoint> (); for (int i = 1, n = 11; i < n; ++i) { int value = (m_rand.Next () % 30) + 1; NChartPointState state = NChartPointState.PointStateAlignedToXWithXY (i, value); // Let the line have markers in the points. state.Marker = new NChartMarker (); state.Marker.Shape = NChartMarkerShape.Circle; if (i > 1) { NChartPointState prevState = result[result.Count - 1].CurrentState; FloatingColorViewController.m_length += FloatingColorViewController.hypot(state.DoubleX - prevState.DoubleX, state.DoubleY - prevState.DoubleY); } result.Add (NChartPoint.PointWithState (state, series)); if (i > 1 && i < n - 1) { NChartPointState addlState = NChartPointState.PointStateAlignedToXWithXY (i, value); addlState.Marker = new NChartMarker (); addlState.Marker.Shape = NChartMarkerShape.Circle; result.Add (NChartPoint.PointWithState (addlState, series)); } } return result.ToArray (); }
public NChartPoint [] SeriesDataSourcePointsForSeries (NChartSeries series) { // Create points with some data for the series. List<NChartPoint> result = new List<NChartPoint> (); switch (type) { case SeriesType.Column2D: for (int i = 0; i <= 10; ++i) result.Add (NChartPoint.PointWithState (NChartPointState.PointStateAlignedToXWithXY (i, (m_rand.Next () % 30) + 1), series)); break; case SeriesType.Column3D: case SeriesType.ColumnCylinder: for (int i = 0; i <= 4; ++i) for (int j = 0; j <= 4; ++j) result.Add (NChartPoint.PointWithState (NChartPointState.PointStateAlignedToXZWithXYZ (i, (m_rand.Next () % 30) + 1, j), series)); break; case SeriesType.Bar2D: for (int i = 0; i <= 10; ++i) result.Add (NChartPoint.PointWithState (NChartPointState.PointStateAlignedToYWithXY ((m_rand.Next () % 30) + 1, i), series)); break; case SeriesType.Bar3D: case SeriesType.BarCylinder: for (int i = 0; i <= 4; ++i) for (int j = 0; j <= 4; ++j) result.Add (NChartPoint.PointWithState (NChartPointState.PointStateAlignedToYZWithXYZ ((m_rand.Next () % 30) + 1, i, j), series)); break; case SeriesType.Area2D: case SeriesType.Line2D: case SeriesType.Step2D: case SeriesType.Radar: for (int i = 0; i <= 10; ++i) result.Add (NChartPoint.PointWithState (NChartPointState.PointStateAlignedToXWithXY (i, (m_rand.Next () % 30) + 1), series)); break; case SeriesType.Area3D: case SeriesType.Line3D: case SeriesType.Step3D: case SeriesType.Ribbon: for (int i = 0; i <= 10; ++i) result.Add (NChartPoint.PointWithState (NChartPointState.PointStateAlignedToXZWithXYZ (i, (m_rand.Next () % 30) + 1, series.Tag), series)); break; case SeriesType.Pie2D: case SeriesType.Pie3D: case SeriesType.Doughnut2D: case SeriesType.Doughnut3D: for (int i = 0; i <= 10; ++i) result.Add (NChartPoint.PointWithState (NChartPointState.PointStateWithCircleValue (i, (m_rand.Next () % 30) + 1), series)); break; case SeriesType.Bubble2D: case SeriesType.Bubble3D: { 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]; if (type == SeriesType.Bubble2D) { state.Marker.Shape = NChartMarkerShape.Circle; state.Marker.Brush.ShadingModel = NChartShadingModel.Plain; state.Marker.Brush.Opacity = 0.8f; } else { state.Marker.Shape = NChartMarkerShape.Sphere; state.Marker.Brush.ShadingModel = NChartShadingModel.Phong; } result.Add (NChartPoint.PointWithState (state, series)); } break; case SeriesType.Scatter2D: case SeriesType.Scatter3D: for (int i = 0; i <= 10; ++i) { 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 = 1.0f; state.Marker.Brush = brushes [series.Tag]; if (type == SeriesType.Scatter2D) { state.Marker.Shape = NChartMarkerShape.Circle; state.Marker.Brush.ShadingModel = NChartShadingModel.Plain; state.Marker.Brush.Opacity = 0.8f; } else { state.Marker.Shape = NChartMarkerShape.Sphere; state.Marker.Brush.ShadingModel = NChartShadingModel.Phong; } result.Add (NChartPoint.PointWithState (state, series)); } break; case SeriesType.Surface: { double y = 0.0, normalY; double x, z; float minRed = 36.0f, minGreen = 136.0f, minBlue = 201.0f; float maxRed = 122.0f, maxGreen = 254.0f, maxBlue = 254.0f; for (int i = 0, n = 20; i < n; ++i) { for (int j = 0, m = 20; j < m; ++j) { x = (double)(i) * 2.0 * Math.PI / (double)n; z = (double)(j) * 2.0 * Math.PI / (double)m; y = Math.Sin (x) * Math.Cos (z); NChartPointState state = NChartPointState.PointStateWithXYZ (i, y, j); normalY = (y + 1.0) / 2.0; state.Brush = NChartSolidColorBrush.SolidColorBrushWithColor (UIColor.FromRGB ( (int)((1.0 - normalY) * minRed + normalY * maxRed), (int)((1.0 - normalY) * minGreen + normalY * maxGreen), (int)((1.0 - normalY) * minBlue + normalY * maxBlue) )); result.Add (NChartPoint.PointWithState (state, series)); } } } break; case SeriesType.Candlestick2D: case SeriesType.Candlestick3D: case SeriesType.OHLC2D: case SeriesType.OHLC3D: for (int i = 0; i < 30; ++i) { double open = 5.0f * Math.Sin ((float)i * Math.PI / 10); double close = 5.0f * Math.Cos ((float)i * Math.PI / 10); double low = Math.Min (open, close) - (m_rand.Next () % 3); double high = Math.Max (open, close) + (m_rand.Next () % 3); result.Add (NChartPoint.PointWithState (NChartPointState.PointStateAlignedToXZWithXZLowOpenCloseHigh ( i, series.Tag, low, open, close, high ), series)); } break; case SeriesType.Band: for (int i = 0; i < 10; ++i) { double low = m_rand.Next () % 20; double high = m_rand.Next () % 20; result.Add (NChartPoint.PointWithState (NChartPointState.PointStateAlignedToXWithXLowHigh ( i, low, high ), series)); } break; case SeriesType.Sequence: for (int i = 0; i < 30; ++i) { int y = m_rand.Next () % 4; double open = m_rand.Next () % 30; double close = open + 1.0; result.Add (NChartPoint.PointWithState (NChartPointState.PointStateAlignedToYWithYOpenClose ( y, open, close ), series)); } break; case SeriesType.Funnel2D: case SeriesType.Funnel3D: result.Add (NChartPoint.PointWithState (NChartPointState.PointStateWithXYZ (0, m_rand.Next () % 30, 0), series)); break; case SeriesType.Heatmap: for (int i = 0, n = 75; i < n; ++i) { for (int j = 0, m = 75; j < m; ++j) { double x = 1.0 - 2.0 * (double)(i) / (double)(n); double y = 1.0 - 2.0 * (double)(j) / (double)(m); double value = (1.0 - Math.Abs(x * y)) * Math.Sin((1.0 - Math.Abs(x * y)) * Math.PI * 4.0); result.Add (NChartPoint.PointWithState (NChartPointState.PointStateWithXYValue (x, y, value), series)); } } break; } return result.ToArray (); }
public string SeriesDataSourceNameForSeries (NChartSeries series) { // Get name of the series. return "My series"; }
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; }
public NChartPoint[] ExtraPoints(NChartSeries series) { return(null); }
public Bitmap Image(NChartSeries series) { return(null); }
public string Name(NChartSeries series) { return(string.Format("My series {0}", series.Tag + 1)); }
public string Name(NChartSeries series) { // Get name of the series. return("My series"); }
public string Name(NChartSeries series) { // Get name of the series. return(series.Tag == 1 ? "Smoothed" : "Linear"); }
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; }
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; }
public string Name(NChartSeries series) { // Get name of the series. return(string.Format("My series {0}", series.Tag + 1)); }
public string SeriesDataSourceNameForSeries (NChartSeries series) { // Get name of the series. return string.Format ("My series {0}", series.Tag + 1); }
public string NameForSeries (NChartSeries series) { return "My series in 3D"; }
// If you don't want to implement method, return null. public UIImage SeriesDataSourceImageForSeries (NChartSeries series) { return null; }
public string NameForSeries (NChartSeries series) { // Get name of the series. return string.Format ("My series {0}", series.Tag); }
// If you don't want to implement method, return null. public UIImage Image(NChartSeries series) { return(null); }
public NChartPoint[] PointsForSeries (NChartSeries series) { // Create points for series as seen on the picture. A bit wired logic: we double the points in the middle of // line to have individual segments. This will help us to achieve the effect of floating color. Also we calculate // the length of the line. List<NChartPoint> points = new List<NChartPoint> (); length = 0.0; for (int i = 1, n = 11; i < n; ++i) { int value = random.Next (30) + 1; NChartPointState state = NChartPointState.PointStateAlignedToXWithXY (i, value); // Let the line have markers in the points. state.Marker = new NChartMarker (); state.Marker.Shape = NChartTypes.MarkerShape.Circle; if (i > 1) { NChartPointState prevState = points [points.Count - 1].CurrentState; length += hypot (state.DoubleX - prevState.DoubleX, state.DoubleY - prevState.DoubleY); } points.Add (new NChartPoint (state, series)); if (i > 1 && i < n - 1) { NChartPointState addlState = NChartPointState.PointStateAlignedToXWithXY (i, value); addlState.Marker = new NChartMarker (); addlState.Marker.Shape = NChartTypes.MarkerShape.Circle; points.Add (new NChartPoint (addlState, series)); } } return points.ToArray (); }
public Bitmap BitmapForSeries (NChartSeries series) { return null; }
public string Name(NChartSeries series) { return("My series"); }