2017-02-24 5 views
1

Android 앱에서 그래프를 그리기 위해 GraphView 라이브러리를 사용하고 있으며 지금까지 라이브러리에 매우 만족합니다. 나는 그것을 고정 된 프레임 실시간 시나리오에서 사용하고 있으며 x 축과 y 축 그리드 선이 다른 단위 그리드 선보다 두껍다는 것을 알았습니다. 내가 다른 라인과 비슷하게 만들 수있는 방법이 있습니까?GraphView Android, 원본 X 축 및 Y 축의 두께를 변경하는 방법은 무엇입니까?

GraphView graph = (GraphView) cardView.findViewById(R.id.graph); 

// Set manual X bounds 
graph.getViewport().setXAxisBoundsManual(true); 
graph.getViewport().setMinX(0); 
graph.getViewport().setMaxX(40); 

// Set manual Y bounds 
graph.getViewport().setYAxisBoundsManual(true); 
graph.getViewport().setMinY(-40); 
graph.getViewport().setMaxY(60); 

// Draw a border between between labels and viewport 
graph.getViewport().setDrawBorder(false); 

graph.getGridLabelRenderer().setHumanRounding(false); 
graph.getGridLabelRenderer().setNumHorizontalLabels(11); 
graph.getGridLabelRenderer().setNumVerticalLabels(6); 

기본적으로 나는 이것을 변경하려면이에

enter image description here

을 : 사전에

enter image description here

감사합니다!

답변

1

가있다 GridLabelRenderer 클래스의 메소드는 setHighlightZeroLines입니다. true 기본적으로 같은 코드 뭔가 :

graphView.getGridLabelRenderer().setHighlightZeroLines(false);

당신이 원하는 것을해야한다.

1

자세히 선 그래프 시리즈를 찾아주세요 :

Line Graph Series in detail

// 시리즈를

series.setTitle("Random Curve 1"); 
series.setColor(Color.GREEN); 
series.setDrawDataPoints(true); 
series.setDataPointsRadius(10); 
series.setThickness(8); 

// 사용자 정의 페인트를 스타일링하는 점선을 만들기 위해

Paint paint = new Paint(); 
paint.setStyle(Paint.Style.STROKE); 
paint.setStrokeWidth(10); 
paint.setPathEffect(new DashPathEffect(new float[]{8, 5}, 0)); 
series2.setCustomPaint(paint); 
+0

답장을 보내 주셔서 감사합니다. 그러나 언급하신 내용은 내가 찾고있는 그리드 라인이 아닌 데이터 시리즈 (그래프 트레이스)를 수정하는 데 사용됩니다. 나는 해명을 위해 이미지를 편집했다. – svahidhoss