2013-07-01 5 views
0

나는 android에 익숙하며 작성이나 그래프의 그리기를 android에서 배우려고합니다.그래프/플롯 ANDROID

  1. GraphView
  2. AndroidPlot : 나는이 라이브러리를 건너했습니다.

내 의도는 사운드 파일을 받고 그래프로 그려 보는 것입니다. 그래서,이 목적을 위해서 어떤 도서관이 더 좋을까요. 또한 위의 라이브러리에서 사용 된 API의 구조 및 코드, 즉 라이브러리의 전체 구현 또는 정의를 볼 수있는 곳을 알고 싶습니다.

또한 인터넷에서 사용할 수있는 몇 가지 샘플 코드를 사용해 보았습니다. 하지만 내가 일식 ADT에서 개발할 수있는 더 정교한 코드를 찾고 있는데, 따라서 그것의 무언가를 배울 수 있습니다.

+0

피치를 플로팅하고 계십니까? – DevZer0

+0

나는 일정한 시간 간격으로 사운드 파일을 그려보고 싶다. 유용한 라이브러리/API를 제안 해주십시오. 가능한 경우 [email protected]에 답장을 게시 할 수 있습니다. 가능한 경우 ssample 코드를 제공하십시오. – user2537915

답변

0

캔버스를 사용하여 간단한 선 그래프를 그려 그래프를 그리는 경우.

1

내 의도는 일부 사운드 파일을 수신하고 그래프

어느 라이브러리는 기본적으로이 작업을 수행에 음모하는 것입니다. 라이브러리는 데이터 요소 세트가있는 그래프를 그리는 데 사용됩니다. 사운드 파일로부터 데이터 포인트를 얻는 것은 당신에게 달려 있습니다.

따라서 어떤 라이브러리가 더 좋을까요?

데이터 포인트를 얻은 후에는 어느 라이브러리를 사용해도 좋을 것입니다.

또한 알고 싶습니다. 위의 라이브러리에서 사용 된 API의 구조와 코드에 대한 전체 구현 또는 정의를 볼 수 있습니다.

GraphViewAndroidPlot에 대한 출처를 확인하십시오.

1

나는 Achartengine을 몇 번 사용했으며 훌륭하게 작동합니다. 나는 그것을 어려움없이 수정했다.

0

AndroidPlot을 사용하십시오. 이 코드는 Vector의 내용을 그립니다 (이 경우 0으로 채워짐). wav 파일의 정보 만 벡터에 전달하면됩니다. 그리고이 스레드에서 독서 문제를 확인할 수 있습니다. Android: Reading wav file and displaying its values

plot = (XYPlot) findViewById(R.id.Grafica); 
    plot.setDomainStep(XYStepMode.INCREMENT_BY_VAL, 0.5); 
    plot.setRangeStep(XYStepMode.INCREMENT_BY_VAL, 1); 

    plot.getGraphWidget().getGridBackgroundPaint().setColor(Color.rgb(255, 255, 255)); 
    plot.getGraphWidget().getDomainGridLinePaint().setColor(Color.rgb(255, 255, 255)); 
    plot.getGraphWidget().getRangeGridLinePaint().setColor(Color.rgb(255, 255, 255)); 

    plot.getGraphWidget().setDomainLabelPaint(null); 
    plot.getGraphWidget().setRangeLabelPaint(null); 
    plot.getGraphWidget().setDomainOriginLabelPaint(null); 
    plot.getGraphWidget().setRangeOriginLabelPaint(null); 
    plot.setBorderStyle(BorderStyle.NONE, null, null); 

    plot.getLayoutManager().remove(plot.getLegendWidget()); 
    plot.getLayoutManager().remove(plot.getDomainLabelWidget()); 
    plot.getLayoutManager().remove(plot.getRangeLabelWidget()); 
    plot.getLayoutManager().remove(plot.getTitleWidget()); 


    //plot.getBackgroundPaint().setColor(Color.WHITE); 
    //plot.getGraphWidget().getBackgroundPaint().setColor(Color.WHITE); 

    plot.setRangeBoundaries(-25, 25, BoundaryMode.FIXED);// check that, these //boundaries wasn't for audio files 
    InicializarLasVariables(); 
    for(int i=0; i<min/11;i++){ 

     DatoY=0; 
     Vector.add(DatoY); 
     } 
     XYSeries series = new SimpleXYSeries(Vector, SimpleXYSeries.ArrayFormat.Y_VALS_ONLY,""); 
     LineAndPointFormatter seriesFormat = new LineAndPointFormatter(Color.rgb(0, 0, 0), 0x000000, 0x000000, null); 
     plot.clear(); 
     plot.addSeries(series, seriesFormat);