1. 程式人生 > >android開源圖表庫MPAndroidChart文件翻譯(上)

android開源圖表庫MPAndroidChart文件翻譯(上)

public interface OnChartGestureListener {

    /**
     * Callbacks when a touch-gesture has started on the chart (ACTION_DOWN)
     *
     * @param me
     * @param lastPerformedGesture
     */
    void onChartGestureStart(MotionEvent me, ChartTouchListener.ChartGesture lastPerformedGesture);

    /**
     * Callbacks when a touch-gesture has ended on the chart (ACTION_UP, ACTION_CANCEL)
     *
     * @param me
     * @param lastPerformedGesture
     */
    void onChartGestureEnd(MotionEvent me, ChartTouchListener.ChartGesture lastPerformedGesture);

    /**
     * Callbacks when the chart is longpressed.
     * 
     * @param me
     */
    public void onChartLongPressed(MotionEvent me);

    /**
     * Callbacks when the chart is double-tapped.
     * 
     * @param me
     */
    public void onChartDoubleTapped(MotionEvent me);

    /**
     * Callbacks when the chart is single-tapped.
     * 
     * @param me
     */
    public void onChartSingleTapped(MotionEvent me);

    /**
     * Callbacks then a fling gesture is made on the chart.
     * 
     * @param me1
     * @param me2
     * @param velocityX
     * @param velocityY
     */
    public void onChartFling(MotionEvent me1, MotionEvent me2, float velocityX, float velocityY);

   /**
     * Callbacks when the chart is scaled / zoomed via pinch zoom gesture.
     * 
     * @param me
     * @param scaleX scalefactor on the x-axis
     * @param scaleY scalefactor on the y-axis
     */
    public void onChartScale(MotionEvent me, float scaleX, float scaleY);

   /**
    * Callbacks when the chart is moved / translated via drag gesture.
    *
    * @param me
    * @param dX translation distance on the x-axis
    * @param dY translation distance on the y-axis
    */
    public void onChartTranslate(MotionEvent me, float dX, float dY);
}

三、軸AxisBase 

主要是AxisBase 這個類,他是XAxis 和YAxis的基類。
下面提到的方法可以應用到這兩個軸。
軸類允許自定義樣式和(可以包含)由以下元件/部件:
標籤(在垂直(y軸)或水平(x軸)對齊),其中包含軸描述值
繪製了一個所謂的“axis-line”,在標籤旁邊直接繪製,與標籤平行
LimitLines,允許存在特殊的資訊,如邊界或限制。

1、控制應該繪製哪些部分(軸)

setEnabled(boolean enabled): 是否啟用軸,如果禁用,關於軸的設定所有屬性都將被忽略
setDrawLabels(boolean enabled): 是否繪製標籤
setDrawAxisLine(boolean enabled): 是否繪製軸線
setDrawGridLines(boolean enabled):是否和網格軸線