Java源码示例:com.github.mikephil.charting.renderer.DataRenderer

示例1
/**
 * Sets a new DataRenderer object for the chart.
 *
 * @param renderer
 */
public void setRenderer(DataRenderer renderer) {

    if (renderer != null) {
        mRenderer = renderer;
    }
}
 
示例2
@Override
public void drawHighlighted(Canvas c, Highlight[] indices) {

    Chart chart = mChart.get();
    if (chart == null) return;

    for (DataRenderer renderer : mRenderers) {
        ChartData data = null;

        if (renderer instanceof BarChartRenderer)
            data = ((BarChartRenderer)renderer).mChart.getBarData();
        else if (renderer instanceof AppLineChartRenderer)
            data = ((AppLineChartRenderer)renderer).mChart.getLineData();
        else if (renderer instanceof CandleStickChartRenderer)
            data = ((CandleStickChartRenderer)renderer).mChart.getCandleData();
        else if (renderer instanceof ScatterChartRenderer)
            data = ((ScatterChartRenderer)renderer).mChart.getScatterData();
        else if (renderer instanceof BubbleChartRenderer)
            data = ((BubbleChartRenderer)renderer).mChart.getBubbleData();

        int dataIndex = data == null ? -1
                : ((CombinedData)chart.getData()).getAllData().indexOf(data);

        mHighlightBuffer.clear();

        for (Highlight h : indices) {
            if (h.getDataIndex() == dataIndex || h.getDataIndex() == -1)
                mHighlightBuffer.add(h);
        }

        renderer.drawHighlighted(c, mHighlightBuffer.toArray(new Highlight[mHighlightBuffer.size()]));
    }
}
 
示例3
/**
 * Returns the sub-renderer object at the specified index.
 *
 */
public DataRenderer getSubRenderer(int index) {
    if (index >= mRenderers.size() || index < 0)
        return null;
    else
        return mRenderers.get(index);
}
 
示例4
/**
 * Sets a new DataRenderer object for the chart.
 *
 * @param renderer
 */
public void setRenderer(DataRenderer renderer) {

    if (renderer != null)
        mRenderer = renderer;
}
 
示例5
/**
 * Sets a new DataRenderer object for the chart.
 *
 * @param renderer
 */
public void setRenderer(DataRenderer renderer) {

    if (renderer != null)
        mRenderer = renderer;
}
 
示例6
@Override
public void initBuffers() {

    for (DataRenderer renderer : mRenderers)
        renderer.initBuffers();
}
 
示例7
@Override
public void drawData(Canvas c) {

    for (DataRenderer renderer : mRenderers)
        renderer.drawData(c);
}
 
示例8
@Override
public void drawValues(Canvas c) {

    for (DataRenderer renderer : mRenderers)
        renderer.drawValues(c);
}
 
示例9
@Override
public void drawExtras(Canvas c) {

    for (DataRenderer renderer : mRenderers)
        renderer.drawExtras(c);
}
 
示例10
public void setSubRenderers(List<DataRenderer> renderers) {
    this.mRenderers = renderers;
}
 
示例11
/**
 * Sets a new DataRenderer object for the chart.
 * 
 * @param renderer
 */
public void setRenderer(DataRenderer renderer) {

    if (renderer != null)
        mRenderer = renderer;
}
 
示例12
/**
 * Sets a new DataRenderer object for the chart.
 *
 * @param renderer
 */
public void setRenderer(DataRenderer renderer) {

    if (renderer != null)
        mRenderer = renderer;
}
 
示例13
/**
 * Sets a new DataRenderer object for the chart.
 *
 * @param renderer
 */
public void setRenderer(DataRenderer renderer) {

    if (renderer != null)
        mRenderer = renderer;
}
 
示例14
/**
 * Returns the Renderer object the chart uses for drawing data.
 *
 * @return
 */
public DataRenderer getRenderer() {
    return mRenderer;
}
 
示例15
/**
 * Returns the Renderer object the chart uses for drawing data.
 *
 * @return
 */
public DataRenderer getRenderer() {
    return mRenderer;
}
 
示例16
/**
 * Returns the Renderer object the chart uses for drawing data.
 *
 * @return
 */
public DataRenderer getRenderer() {
    return mRenderer;
}
 
示例17
/**
 * Returns all sub-renderers.
 *
 */
public List<DataRenderer> getSubRenderers() {
    return mRenderers;
}
 
示例18
/**
 * Returns the Renderer object the chart uses for drawing data.
 * 
 * @return
 */
public DataRenderer getRenderer() {
    return mRenderer;
}
 
示例19
/**
 * Returns the Renderer object the chart uses for drawing data.
 *
 * @return
 */
public DataRenderer getRenderer() {
    return mRenderer;
}
 
示例20
/**
 * Returns the Renderer object the chart uses for drawing data.
 *
 * @return
 */
public DataRenderer getRenderer() {
    return mRenderer;
}