Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/232.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/91.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何增加散点图中圆点的半径?_Android - Fatal编程技术网

Android 如何增加散点图中圆点的半径?

Android 如何增加散点图中圆点的半径?,android,Android,我在android应用程序中使用了下面的代码来生成散点图,但问题是在图形中散点圆的半径非常小,所以很难看到。 我不知道如何增加圆的半径。。。 应用程序正在为Galaxy选项卡创建 请帮忙 public class page_twenty extends Activity { public static final String TYPE = "type"; int[] colors = new int[] { Color.BLUE, Color.GREEN , Color.CY

我在android应用程序中使用了下面的代码来生成散点图,但问题是在图形中散点圆的半径非常小,所以很难看到。 我不知道如何增加圆的半径。。。 应用程序正在为Galaxy选项卡创建

请帮忙

public class page_twenty extends Activity 
{
    public static final String TYPE = "type";
    int[] colors = new int[] { Color.BLUE, Color.GREEN , Color.CYAN};

    PointStyle[] styles = new PointStyle[] { PointStyle.CIRCLE, PointStyle.CIRCLE ,PointStyle.CIRCLE };
    XYMultipleSeriesRenderer renderer = buildRenderer(colors, styles);

    private GraphicalView mChartView;
    LinearLayout chart;


     String[] titles = new String[] { "", "", ""};
     int length;
     List<double[]> x = new ArrayList<double[]>();
     List<double[]> x1 = new ArrayList<double[]>();
     List<double[]> x2 = new ArrayList<double[]>();

     List<double[]> values = new ArrayList<double[]>();
     List<double[]> values1 = new ArrayList<double[]>();
     List<double[]> values2 = new ArrayList<double[]>();

    @Override
    protected void onRestoreInstanceState(Bundle savedState) 
    {
        super.onRestoreInstanceState(savedState);
        renderer = buildRenderer(colors, styles);
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) 
    {
        super.onSaveInstanceState(outState);
    }

    protected void onCreate(Bundle savedInstanceState) 
    {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.twenty);

        chart = (LinearLayout) findViewById(R.id.chart);  

        int count = 4;
        length = titles.length;

        Random r = new Random();
        for (int i = 0; i < length; i++) 
        {
          double[] xValues = new double[count];
          double[] yValues = new double[count];

          double[] xValues1 = new double[count];
          double[] yValues1 = new double[count];

          double[] xValues2 = new double[count];
          double[] yValues2 = new double[count];

          for (int k = 0; k < count; k++) 
          {
            //xValues[k] = k + r.nextInt() % 10;
            //yValues[k] = k * 2 + r.nextInt() % 10;

              xValues[0] = 6;
              yValues[0] = 65;
              xValues[1] = 19;
              yValues[1] = 70;
              xValues[2] = 31;
              yValues[2] = 80;
              xValues[3] = 43;
              yValues[3] = 90;

              xValues1[0] = 6;
              yValues1[0] = 60;
              xValues1[1] = 19;
              yValues1[1] = 65;
              xValues1[2] = 31;
              yValues1[2] = 60;
              xValues1[3] = 43;
              yValues1[3] = 70;

              xValues2[0] = 6;
              yValues2[0] = 62;
              xValues2[1] = 19;
              yValues2[1] = 67.5;
              xValues2[2] = 31;
              yValues2[2] = 70;
              xValues2[3] = 43;
              yValues2[3] = 85;
          }
          x.add(xValues);
          values.add(yValues);

          x1.add(xValues1);
          values1.add(yValues1);

          x2.add(xValues2);
          values2.add(yValues2);
        }    


        setChartSettings(renderer, "", "", "", 0, 50, 60, 92, Color.GRAY,Color.LTGRAY);
        renderer.setXLabels(0);
        renderer.setYLabels(10);
        length = renderer.getSeriesRendererCount();
        for (int i = 0; i < length; i++) 
        {
          ((XYSeriesRenderer) renderer.getSeriesRendererAt(i)).setFillPoints(true);
        }

         if (mChartView != null) 
         {
              mChartView.repaint();
         }     
    }

    protected void setChartSettings(XYMultipleSeriesRenderer renderer, String title, String xTitle,
              String yTitle, double xMin, double xMax, double yMin, double yMax, int axesColor,
              int labelsColor) 
    {
            renderer.setChartTitle(title);
            renderer.setXTitle(xTitle);
            renderer.setYTitle(yTitle);
            renderer.setXAxisMin(xMin);
            renderer.setXAxisMax(xMax);
            renderer.setYAxisMin(yMin);
            renderer.setYAxisMax(yMax);
            renderer.setAxesColor(axesColor);
            renderer.setLabelsColor(labelsColor);
            renderer.setShowLegend(false);
            renderer.setLabelsTextSize(15);
          }

    protected XYMultipleSeriesRenderer buildRenderer(int[] colors, PointStyle[] styles) 
    {
        XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
        int length = colors.length;
        for (int i = 0; i < length; i++) 
        {
          XYSeriesRenderer r = new XYSeriesRenderer();
          r.setColor(colors[i]);
          r.setPointStyle(styles[i]);
          renderer.addSeriesRenderer(r);
        }
        return renderer;
      }

     protected XYMultipleSeriesDataset buildDataset(String[] titles, List<double[]> xValues,List<double[]> yValues,
             List<double[]> xValues1,List<double[]> yValues1, List<double[]> xValues2,List<double[]> yValues2) 
     {
            XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
            int length = titles.length;
            for (int i = 0; i < length; i++) 
            {
              //XYSeries series = new XYSeries(titles[i]);
              XYSeries series = new XYSeries(titles[i]);
              double[] xV;
              double[] yV;
              if (i==0)
              {
                  xV = xValues.get(i);
                  yV = yValues.get(i);
              }
              else if (i == 1)
              {
                  xV = xValues1.get(i);
                  yV = yValues1.get(i);
              }
              else
              {
                  xV = xValues2.get(i);
                  yV = yValues2.get(i);
              }
              int seriesLength = xV.length;
              for (int k = 0; k < seriesLength; k++) 
              {
                //series.add(xV[k], yV[k]);
                  series.add(xV[k], yV[k]);
                  //series.add(xV1[k], yV1[k]);
                 // series.add(xV2[k], yV2[k]);               
              }
              dataset.addSeries(series);
            }
            return dataset;
     }

    @Override
    protected void onResume()
    {
        super.onResume();
        if (mChartView == null) 
        {

            mChartView = ChartFactory.getScatterChartView(this, buildDataset(titles, x, values,x1, values1,x2, values2), renderer);
            //mChartView = ChartFactory.getRangeBarChartView(this, buildDataset(titles, x, values,x1, values1,x2, values2), renderer,Type.DEFAULT);
            chart.addView(mChartView, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
        } 
        else
        {
            mChartView.repaint();
        }
    }

    private void setSeriesEnabled(boolean enabled) 
    {

    }

}
公共类页面\u活动
{
公共静态最终字符串TYPE=“TYPE”;
int[]colors=newint[]{Color.BLUE,Color.GREEN,Color.CYAN};
PointStyle[]styles=新的PointStyle[]{PointStyle.CIRCLE,PointStyle.CIRCLE,PointStyle.CIRCLE};
XYMultipleReseriesRenderer渲染器=构建渲染器(颜色、样式);
private GraphicalView mChartView;
线性布局图;
字符串[]标题=新字符串[]{“”,“”};
整数长度;
列表x=新的ArrayList();
列表x1=新的ArrayList();
列表x2=新的ArrayList();
列表值=新的ArrayList();
列表值1=新的ArrayList();
列表值2=新的ArrayList();
@凌驾
RestoreInstanceState(Bundle savedState)上受保护的void
{
super.onRestoreInstanceState(savedState);
渲染器=构建渲染器(颜色、样式);
}
@凌驾
SaveInstanceState上受保护的无效(束超出状态)
{
super.onSaveInstanceState(超出状态);
}
创建时受保护的void(Bundle savedInstanceState)
{
//TODO自动生成的方法存根
super.onCreate(savedInstanceState);
setContentView(右布局20);
chart=(线性布局)findViewById(R.id.chart);
整数计数=4;
长度=标题长度;
随机r=新随机();
for(int i=0;i