cn.limc.androidcharts.view
Class StickChart

java.lang.Object
  extended by android.view.View
      extended by cn.limc.androidcharts.view.BaseChart
          extended by cn.limc.androidcharts.view.GridChart
              extended by cn.limc.androidcharts.view.StickChart
All Implemented Interfaces:
android.graphics.drawable.Drawable.Callback, android.view.accessibility.AccessibilityEventSource, android.view.KeyEvent.Callback, ITouchEventNotify, ITouchEventResponse, IChart
Direct Known Subclasses:
MAStickChart, MinusStickChart

public class StickChart
extends GridChart

StickChart is a kind of graph that draw the sticks on a GridChart if you want display some moving average lines on this graph, please use see MAStickChart for more information.

StickChartはGridChartの表面でスティックを書いたラインチャードです。移動平均線など 分析線がお使いしたい場合、MAStickChartにご参照ください。

StickChart是在GridChart上绘制柱状数据的图表、如果需要支持显示均线,请参照 MAStickChart。

Version:
v1.0 2011/05/30 14:58:59
Author:
limc

Nested Class Summary
 
Nested classes/interfaces inherited from class android.view.View
android.view.View.BaseSavedState, android.view.View.MeasureSpec, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnFocusChangeListener, android.view.View.OnKeyListener, android.view.View.OnLongClickListener, android.view.View.OnTouchListener
 
Field Summary
static int DEFAULT_STICK_BORDER_COLOR
           default color for display stick border
static int DEFAULT_STICK_FILL_COLOR
           default color for display stick
 
Fields inherited from class cn.limc.androidcharts.view.GridChart
DEFAULT_AXIS_MARGIN_BOTTOM, DEFAULT_AXIS_MARGIN_LEFT, DEFAULT_AXIS_MARGIN_RIGHT, DEFAULT_AXIS_MARGIN_TOP, DEFAULT_AXIS_X_COLOR, DEFAULT_AXIS_Y_COLOR, DEFAULT_AXIS_Y_MAX_TITLE_LENGTH, DEFAULT_BACKGROUND_COLOR, DEFAULT_BORDER_COLOR, DEFAULT_DASH_EFFECT, DEFAULT_DASH_LATITUDE, DEFAULT_DASH_LONGITUDE, DEFAULT_DISPLAY_AXIS_X_TITLE, DEFAULT_DISPLAY_AXIS_Y_TITLE, DEFAULT_DISPLAY_BORDER, DEFAULT_DISPLAY_CROSS_X_ON_TOUCH, DEFAULT_DISPLAY_CROSS_Y_ON_TOUCH, DEFAULT_DISPLAY_LATITUDE, DEFAULT_DISPLAY_LONGITUDE, DEFAULT_LAITUDE_COLOR, DEFAULT_LATITUDE_FONT_COLOR, DEFAULT_LATITUDE_FONT_SIZE, DEFAULT_LATITUDE_NUM, DEFAULT_LONGITUDE_COLOR, DEFAULT_LONGITUDE_FONT_COLOR, DEFAULT_LONGITUDE_FONT_SIZE, DEFAULT_LONGITUDE_NUM
 
Fields inherited from class android.view.View
DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, GONE, HAPTIC_FEEDBACK_ENABLED, INVISIBLE, KEEP_SCREEN_ON, NO_ID, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SOUND_EFFECTS_ENABLED, VISIBLE
 
Constructor Summary
StickChart(android.content.Context context)
           
StickChart(android.content.Context context, android.util.AttributeSet attrs)
           
StickChart(android.content.Context context, android.util.AttributeSet attrs, int defStyle)
           
 
Method Summary
 void addData(StickEntity entity)
           add a new stick data to sticks
 java.lang.String getAxisXGraduate(java.lang.Object value)
           calculate degree title on X axis
 java.lang.String getAxisYGraduate(java.lang.Object value)
           calculate degree title on Y axis
 int getMaxSticksNum()
           
 float getMaxValue()
           
 float getMinValue()
           
 int getSelectedIndex()
           get current selected data index
 int getStickBorderColor()
           
 java.util.List<StickEntity> getStickData()
           
 int getStickFillColor()
           
 void notifyEvent(GridChart chart)
          Response Notify
 void pushData(StickEntity entity)
           add a new stick data to sticks and refresh this chart
 void setMaxSticksNum(int maxSticksNum)
           
 void setMaxValue(float maxValue)
           
 void setMinValue(float minValue)
           
 void setStickBorderColor(int stickBorderColor)
           
 void setStickData(java.util.List<StickEntity> stickData)
           
 void setStickFillColor(int stickFillColor)
           
 
Methods inherited from class cn.limc.androidcharts.view.GridChart
addNotify, getAxisMarginBottom, getAxisMarginLeft, getAxisMarginRight, getAxisMarginTop, getAxisXColor, getAxisXTitles, getAxisYColor, getAxisYMaxTitleLength, getAxisYTitles, getBackgroundColor, getBorderColor, getClickPostX, getClickPostY, getDashEffect, getLatitudeColor, getLatitudeFontColor, getLatitudeFontSize, getLatitudeNum, getLongitudeColor, getLongitudeFontColor, getLongitudeFontSize, getLongitudeNum, getNotifyList, getTouchPoint, isDashLatitude, isDashLongitude, isDisplayAxisXTitle, isDisplayAxisYTitle, isDisplayBorder, isDisplayCrossXOnTouch, isDisplayCrossYOnTouch, isDisplayLatitude, isDisplayLongitude, notifyEventAll, onTouchEvent, removeAllNotify, removeNotify, setAxisMarginBottom, setAxisMarginLeft, setAxisMarginRight, setAxisMarginTop, setAxisXColor, setAxisXTitles, setAxisYColor, setAxisYMaxTitleLength, setAxisYTitles, setBackgroundColor, setBorderColor, setClickPostX, setClickPostY, setDashEffect, setDashLatitude, setDashLongitude, setDisplayAxisXTitle, setDisplayAxisYTitle, setDisplayBorder, setDisplayCrossXOnTouch, setDisplayCrossYOnTouch, setDisplayLatitude, setDisplayLongitude, setLatitudeColor, setLatitudeFontColor, setLatitudeFontSize, setLatitudeNum, setLongitudeColor, setLongitudeFontColor, setLongitudeFontSize, setLongitudeNum, setNotifyList, setTouchPoint
 
Methods inherited from class android.view.View
addFocusables, addFocusables, addTouchables, bringToFront, buildDrawingCache, buildDrawingCache, cancelLongPress, checkInputConnectionProxy, clearAnimation, clearFocus, computeScroll, createContextMenu, destroyDrawingCache, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowVisibilityChanged, draw, findFocus, findViewById, findViewWithTag, focusSearch, forceLayout, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getContentDescription, getContext, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getId, getKeepScreenOn, getKeyDispatcherState, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMeasuredHeight, getMeasuredWidth, getNextFocusDownId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getResources, getRight, getRootView, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getTag, getTag, getTop, getTouchables, getTouchDelegate, getVerticalFadingEdgeLength, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, hasFocus, hasFocusable, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, isClickable, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isInEditMode, isInTouchMode, isLayoutRequested, isLongClickable, isOpaque, isPressed, isSaveEnabled, isScrollbarFadingEnabled, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, layout, measure, offsetLeftAndRight, offsetTopAndBottom, onCheckIsTextEditor, onCreateInputConnection, onFinishTemporaryDetach, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onStartTemporaryDetach, onTrackballEvent, onWindowFocusChanged, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, refreshDrawableState, removeCallbacks, requestFocus, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAnimation, setBackgroundDrawable, setBackgroundResource, setClickable, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setId, setKeepScreenOn, setLayoutParams, setLongClickable, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnClickListener, setOnCreateContextMenuListener, setOnFocusChangeListener, setOnKeyListener, setOnLongClickListener, setOnTouchListener, setPadding, setPressed, setSaveEnabled, setScrollbarFadingEnabled, setScrollBarStyle, setScrollContainer, setSelected, setSoundEffectsEnabled, setTag, setTag, setTouchDelegate, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVisibility, setWillNotCacheDrawing, setWillNotDraw, showContextMenu, startAnimation, unscheduleDrawable, unscheduleDrawable, willNotCacheDrawing, willNotDraw
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_STICK_BORDER_COLOR

public static final int DEFAULT_STICK_BORDER_COLOR

default color for display stick border

表示スティックのボーダーの色のデフォルト値

默认表示柱条的边框颜色

See Also:
Constant Field Values

DEFAULT_STICK_FILL_COLOR

public static final int DEFAULT_STICK_FILL_COLOR

default color for display stick

表示スティックの色のデフォルト値

默认表示柱条的填充颜色

See Also:
Constant Field Values
Constructor Detail

StickChart

public StickChart(android.content.Context context)

StickChart

public StickChart(android.content.Context context,
                  android.util.AttributeSet attrs,
                  int defStyle)

StickChart

public StickChart(android.content.Context context,
                  android.util.AttributeSet attrs)
Method Detail

getAxisXGraduate

public java.lang.String getAxisXGraduate(java.lang.Object value)
Description copied from class: GridChart

calculate degree title on X axis

X軸の目盛を計算する

计算X轴上显示的坐标值

Overrides:
getAxisXGraduate in class GridChart
Parameters:
value -

value for calculate

計算有用データ

计算用数据

Returns:
String

degree

目盛

坐标值


getAxisYGraduate

public java.lang.String getAxisYGraduate(java.lang.Object value)
Description copied from class: GridChart

calculate degree title on Y axis

Y軸の目盛を計算する

计算Y轴上显示的坐标值

Overrides:
getAxisYGraduate in class GridChart
Parameters:
value -

value for calculate

計算有用データ

计算用数据

Returns:
String

degree

目盛

坐标值


notifyEvent

public void notifyEvent(GridChart chart)
Description copied from interface: ITouchEventResponse

Response Notify

レスポンスをする

响应通知

Specified by:
notifyEvent in interface ITouchEventResponse
Overrides:
notifyEvent in class GridChart
Parameters:
chart -

source chart

ソースチャート

源头对象


getSelectedIndex

public int getSelectedIndex()

get current selected data index

選択したスティックのインデックス

获取当前选中的柱条的index

Returns:
int

index

インデックス

index


pushData

public void pushData(StickEntity entity)

add a new stick data to sticks and refresh this chart

新しいスティックデータを追加する,フラフをレフレシューする

追加一条新数据并刷新当前图表

Parameters:
entity -

data

データ

新数据


addData

public void addData(StickEntity entity)

add a new stick data to sticks

新しいスティックデータを追加する

追加一条新数据

Parameters:
entity -

data

データ

新数据


getStickBorderColor

public int getStickBorderColor()
Returns:
the stickBorderColor

setStickBorderColor

public void setStickBorderColor(int stickBorderColor)
Parameters:
stickBorderColor - the stickBorderColor to set

getStickFillColor

public int getStickFillColor()
Returns:
the stickFillColor

setStickFillColor

public void setStickFillColor(int stickFillColor)
Parameters:
stickFillColor - the stickFillColor to set

getStickData

public java.util.List<StickEntity> getStickData()
Returns:
the stickData

setStickData

public void setStickData(java.util.List<StickEntity> stickData)
Parameters:
stickData - the stickData to set

getMaxSticksNum

public int getMaxSticksNum()
Returns:
the maxSticksNum

setMaxSticksNum

public void setMaxSticksNum(int maxSticksNum)
Parameters:
maxSticksNum - the maxSticksNum to set

getMaxValue

public float getMaxValue()
Returns:
the maxValue

setMaxValue

public void setMaxValue(float maxValue)
Parameters:
maxValue - the maxValue to set

getMinValue

public float getMinValue()
Returns:
the minValue

setMinValue

public void setMinValue(float minValue)
Parameters:
minValue - the minValue to set