com.github.mikephil.charting.interfaces.dataprovider.BarLineScatterCandleBubbleDataProvider Java Examples

The following examples show how to use com.github.mikephil.charting.interfaces.dataprovider.BarLineScatterCandleBubbleDataProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BarLineScatterCandleBubbleRenderer.java    From StockChart-MPAndroidChart with MIT License 5 votes vote down vote up
/**
 * Calculates the minimum and maximum x values as well as the range between them.
 *
 * @param chart
 * @param dataSet
 */
public void set(BarLineScatterCandleBubbleDataProvider chart, IBarLineScatterCandleBubbleDataSet dataSet) {
    float phaseX = Math.max(0.f, Math.min(1.f, mAnimator.getPhaseX()));

    float low = chart.getLowestVisibleX();
    float high = chart.getHighestVisibleX();

    Entry entryFrom = dataSet.getEntryForXValue(low, Float.NaN, DataSet.Rounding.DOWN);
    Entry entryTo = dataSet.getEntryForXValue(high, Float.NaN, DataSet.Rounding.UP);

    min = entryFrom == null ? 0 : dataSet.getEntryIndex(entryFrom);
    max = entryTo == null ? 0 : dataSet.getEntryIndex(entryTo);
    range = (int) ((max - min) * phaseX);
}
 
Example #2
Source File: BarLineScatterCandleBubbleRenderer.java    From Ticket-Analysis with MIT License 5 votes vote down vote up
/**
 * Calculates the minimum and maximum x values as well as the range between them.
 *
 * @param chart
 * @param dataSet
 */
public void set(BarLineScatterCandleBubbleDataProvider chart, IBarLineScatterCandleBubbleDataSet dataSet) {
    float phaseX = Math.max(0.f, Math.min(1.f, mAnimator.getPhaseX()));

    float low = chart.getLowestVisibleX();
    float high = chart.getHighestVisibleX();

    Entry entryFrom = dataSet.getEntryForXValue(low, Float.NaN, DataSet.Rounding.DOWN);
    Entry entryTo = dataSet.getEntryForXValue(high, Float.NaN, DataSet.Rounding.UP);

    min = entryFrom == null ? 0 : dataSet.getEntryIndex(entryFrom);
    max = entryTo == null ? 0 : dataSet.getEntryIndex(entryTo);
    range = (int) ((max - min) * phaseX);
}
 
Example #3
Source File: BarLineScatterCandleBubbleRenderer.java    From android-kline with Apache License 2.0 5 votes vote down vote up
/**
 * Calculates the minimum and maximum x values as well as the range between them.
 *
 * @param chart
 * @param dataSet
 */
public void set(BarLineScatterCandleBubbleDataProvider chart, IBarLineScatterCandleBubbleDataSet dataSet) {
    float phaseX = Math.max(0.f, Math.min(1.f, mAnimator.getPhaseX()));

    float low = chart.getLowestVisibleX();
    float high = chart.getHighestVisibleX();

    Entry entryFrom = dataSet.getEntryForXValue(low, Float.NaN, DataSet.Rounding.DOWN);
    Entry entryTo = dataSet.getEntryForXValue(high, Float.NaN, DataSet.Rounding.UP);

    min = entryFrom == null ? 0 : dataSet.getEntryIndex(entryFrom);
    max = entryTo == null ? 0 : dataSet.getEntryIndex(entryTo);
    range = (int) ((max - min) * phaseX);
}
 
Example #4
Source File: Renderer.java    From Stayfit with Apache License 2.0 5 votes vote down vote up
/**
 * Calculates the minimum and maximum x-value the chart can currently
 * display (with the given zoom level). -> mMinX, mMaxX
 * 
 * @param dataProvider
 * @param xAxisModulus
 */
public void calcXBounds(BarLineScatterCandleBubbleDataProvider dataProvider, int xAxisModulus) {
    
    int low = dataProvider.getLowestVisibleXIndex();
    int high = dataProvider.getHighestVisibleXIndex();
    
    int subLow = (low % xAxisModulus == 0) ? xAxisModulus : 0;
    
    mMinX = Math.max((low / xAxisModulus) * (xAxisModulus) - subLow, 0);
    mMaxX = Math.min((high / xAxisModulus) * (xAxisModulus) + xAxisModulus, (int) dataProvider.getXChartMax());
}
 
Example #5
Source File: Renderer.java    From NetKnight with Apache License 2.0 5 votes vote down vote up
/**
 * Calculates the minimum and maximum x-value the chart can currently
 * display (with the given zoom level). -> mMinX, mMaxX
 * 
 * @param dataProvider
 * @param xAxisModulus
 */
public void calcXBounds(BarLineScatterCandleBubbleDataProvider dataProvider, int xAxisModulus) {
    
    int low = dataProvider.getLowestVisibleXIndex();
    int high = dataProvider.getHighestVisibleXIndex();
    
    int subLow = (low % xAxisModulus == 0) ? xAxisModulus : 0;
    
    mMinX = Math.max((low / xAxisModulus) * (xAxisModulus) - subLow, 0);
    mMaxX = Math.min((high / xAxisModulus) * (xAxisModulus) + xAxisModulus, (int) dataProvider.getXChartMax());
}
 
Example #6
Source File: CombinedChartRenderer.java    From Stayfit with Apache License 2.0 4 votes vote down vote up
@Override
public void calcXBounds(BarLineScatterCandleBubbleDataProvider chart, int xAxisModulus) {
    for (DataRenderer renderer : mRenderers)
        renderer.calcXBounds(chart, xAxisModulus);
}
 
Example #7
Source File: CombinedHighlighter.java    From Stayfit with Apache License 2.0 4 votes vote down vote up
public CombinedHighlighter(BarLineScatterCandleBubbleDataProvider chart) {
    super(chart);
}
 
Example #8
Source File: CombinedChartRenderer.java    From NetKnight with Apache License 2.0 4 votes vote down vote up
@Override
public void calcXBounds(BarLineScatterCandleBubbleDataProvider chart, int xAxisModulus) {
    for (DataRenderer renderer : mRenderers)
        renderer.calcXBounds(chart, xAxisModulus);
}
 
Example #9
Source File: CombinedHighlighter.java    From NetKnight with Apache License 2.0 4 votes vote down vote up
public CombinedHighlighter(BarLineScatterCandleBubbleDataProvider chart) {
    super(chart);
}