/// <summary>
        /// Executes the chart demo.
        /// </summary>
        /// <param name="context"> the context </param>
        /// <returns> the built intent </returns>
        public override Intent execute(Context context)
        {
            XYMultipleSeriesDataset series          = new XYMultipleSeriesDataset();
            XYValueSeries           newTicketSeries = new XYValueSeries("New Tickets");

            newTicketSeries.add(1f, 2, 14);
            newTicketSeries.add(2f, 2, 12);
            newTicketSeries.add(3f, 2, 18);
            newTicketSeries.add(4f, 2, 5);
            newTicketSeries.add(5f, 2, 1);
            series.addSeries(newTicketSeries);
            XYValueSeries fixedTicketSeries = new XYValueSeries("Fixed Tickets");

            fixedTicketSeries.add(1f, 1, 7);
            fixedTicketSeries.add(2f, 1, 4);
            fixedTicketSeries.add(3f, 1, 18);
            fixedTicketSeries.add(4f, 1, 3);
            fixedTicketSeries.add(5f, 1, 1);
            series.addSeries(fixedTicketSeries);

            XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();

            renderer.AxisTitleTextSize  = 16;
            renderer.ChartTitleTextSize = 20;
            renderer.LabelsTextSize     = 15;
            renderer.LegendTextSize     = 15;
            renderer.Margins            = new int[] { 20, 30, 15, 0 };
            XYSeriesRenderer newTicketRenderer = new XYSeriesRenderer();

            newTicketRenderer.Color = Color.BLUE;
            renderer.addSeriesRenderer(newTicketRenderer);
            XYSeriesRenderer fixedTicketRenderer = new XYSeriesRenderer();

            fixedTicketRenderer.Color = Color.GREEN;
            renderer.addSeriesRenderer(fixedTicketRenderer);

            setChartSettings(renderer, "Project work status", "Priority", "", 0.5, 5.5, 0, 5, Color.GRAY, Color.LTGRAY);
            renderer.XLabels  = 7;
            renderer.YLabels  = 0;
            renderer.ShowGrid = false;
            return(ChartFactory.getBubbleChartIntent(context, series, renderer, "Project tickets"));
        }
	  /// <summary>
	  /// Executes the chart demo.
	  /// </summary>
	  /// <param name="context"> the context </param>
	  /// <returns> the built intent </returns>
	  public override Intent execute(Context context)
	  {
		XYMultipleSeriesDataset series = new XYMultipleSeriesDataset();
		XYValueSeries newTicketSeries = new XYValueSeries("New Tickets");
		newTicketSeries.add(1f, 2, 14);
		newTicketSeries.add(2f, 2, 12);
		newTicketSeries.add(3f, 2, 18);
		newTicketSeries.add(4f, 2, 5);
		newTicketSeries.add(5f, 2, 1);
		series.addSeries(newTicketSeries);
		XYValueSeries fixedTicketSeries = new XYValueSeries("Fixed Tickets");
		fixedTicketSeries.add(1f, 1, 7);
		fixedTicketSeries.add(2f, 1, 4);
		fixedTicketSeries.add(3f, 1, 18);
		fixedTicketSeries.add(4f, 1, 3);
		fixedTicketSeries.add(5f, 1, 1);
		series.addSeries(fixedTicketSeries);

		XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
		renderer.AxisTitleTextSize = 16;
		renderer.ChartTitleTextSize = 20;
		renderer.LabelsTextSize = 15;
		renderer.LegendTextSize = 15;
		renderer.Margins = new int[] {20, 30, 15, 0};
		XYSeriesRenderer newTicketRenderer = new XYSeriesRenderer();
		newTicketRenderer.Color = Color.BLUE;
		renderer.addSeriesRenderer(newTicketRenderer);
		XYSeriesRenderer fixedTicketRenderer = new XYSeriesRenderer();
		fixedTicketRenderer.Color = Color.GREEN;
		renderer.addSeriesRenderer(fixedTicketRenderer);

		setChartSettings(renderer, "Project work status", "Priority", "", 0.5, 5.5, 0, 5, Color.GRAY, Color.LTGRAY);
		renderer.XLabels = 7;
		renderer.YLabels = 0;
		renderer.ShowGrid = false;
		return ChartFactory.getBubbleChartIntent(context, series, renderer, "Project tickets");
	  }
Пример #3
0
	  /// <summary>
	  /// Executes the chart demo.
	  /// </summary>
	  /// <param name="context"> the context </param>
	  /// <returns> the built intent </returns>
	  public override Intent execute(Context context)
	  {
		double[] minValues = new double[] {-24, -19, -10, -1, 7, 12, 15, 14, 9, 1, -11, -16};
		double[] maxValues = new double[] {7, 12, 24, 28, 33, 35, 37, 36, 28, 19, 11, 4};

		XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
		RangeCategorySeries series = new RangeCategorySeries("Temperature");
		int length = minValues.Length;
		for (int k = 0; k < length; k++)
		{
		  series.add(minValues[k], maxValues[k]);
		}
		dataset.addSeries(series.toXYSeries());
		int[] colors = new int[] {Color.CYAN};
		XYMultipleSeriesRenderer renderer = buildBarRenderer(colors);
		setChartSettings(renderer, "Monthly temperature range", "Month", "Celsius degrees", 0.5, 12.5, -30, 45, Color.GRAY, Color.LTGRAY);
		renderer.BarSpacing = 0.5;
		renderer.XLabels = 0;
		renderer.YLabels = 10;
		renderer.addXTextLabel(1, "Jan");
		renderer.addXTextLabel(3, "Mar");
		renderer.addXTextLabel(5, "May");
		renderer.addXTextLabel(7, "Jul");
		renderer.addXTextLabel(10, "Oct");
		renderer.addXTextLabel(12, "Dec");
		renderer.addYTextLabel(-25, "Very cold");
		renderer.addYTextLabel(-10, "Cold");
		renderer.addYTextLabel(5, "OK");
		renderer.addYTextLabel(20, "Nice");
		renderer.Margins = new int[] {30, 70, 10, 0};
		renderer.YLabelsAlign = Align.RIGHT;
		SimpleSeriesRenderer r = renderer.getSeriesRendererAt(0);
		r.DisplayChartValues = true;
		r.ChartValuesTextSize = 12;
		r.ChartValuesSpacing = 3;
		r.GradientEnabled = true;
		r.setGradientStart(-20, Color.BLUE);
		r.setGradientStop(20, Color.GREEN);
		return ChartFactory.getRangeBarChartIntent(context, dataset, renderer, Type.DEFAULT, "Temperature range");
	  }