Java Code Examples for com.github.mikephil.charting.data.LineDataSet#setDrawValues()

The following examples show how to use com.github.mikephil.charting.data.LineDataSet#setDrawValues() . 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: TickChart.java    From android-kline with Apache License 2.0 7 votes vote down vote up
private ILineDataSet createSet(int type) {
        LineDataSet set = new LineDataSet(null, String.valueOf(type));
//        set.setAxisDependency(YAxis.AxisDependency.LEFT);
        if (type == TYPE_FULL) {
            set.setHighLightColor(mLineColor);
            set.setDrawHighlightIndicators(true);
//            set.setDrawVerticalHighlightIndicator(false);
            set.setHighlightLineWidth(0.5f);
            set.setCircleColor(mLineColor);
            set.setCircleRadius(1.5f);
            set.setDrawCircleHole(false);
            set.setDrawFilled(true);
            set.setColor(mLineColor);
            set.setLineWidth(1f);
            set.setFillDrawable(new ColorDrawable(transparentColor));
        } else if (type == TYPE_AVE) {
            set.setHighlightEnabled(true);
            set.setColor(ContextCompat.getColor(mContext, R.color.ave_color));
            set.setLineWidth(1f);
            set.setCircleRadius(1.5f);
            set.setDrawCircleHole(false);
            set.setCircleColor(transparentColor);
            set.setLineWidth(0.5f);
        } else {
            set.setHighlightEnabled(true);
            set.setDrawVerticalHighlightIndicator(false);
            set.setHighLightColor(transparentColor);
            set.setColor(mLineColor);
            set.enableDashedLine(3, 40, 0);
            set.setDrawCircleHole(false);
            set.setCircleColor(transparentColor);
            set.setLineWidth(1f);
            set.setVisible(true);
        }
        set.setDrawCircles(false);
        set.setDrawValues(false);
        return set;
    }
 
Example 2
Source File: CurrentDayFragment.java    From shinny-futures-android with GNU General Public License v3.0 6 votes vote down vote up
/**
 * date: 6/1/18
 * author: chenli
 * description: 初始化时产生分时图数据集
 */
private LineDataSet generateLineDataSet(List<Entry> entries, int color, String label, boolean isHighlight, YAxis.AxisDependency axisDependency) {
    LineDataSet set = new LineDataSet(entries, label);
    set.setColor(color);
    set.setLineWidth(0.7f);
    set.setDrawCircles(false);
    set.setDrawCircleHole(false);
    set.setDrawValues(false);
    set.setAxisDependency(axisDependency);
    if (isHighlight) {
        refreshYAxisRange(set);
        set.setHighlightLineWidth(0.7f);
        set.setHighLightColor(mHighlightColor);
    } else {
        set.setHighlightEnabled(false);
    }
    return set;
}
 
Example 3
Source File: KlineFragment.java    From shinny-futures-android with GNU General Public License v3.0 6 votes vote down vote up
private LineDataSet generateMALineDataSet(int para, int color, String label) {
    List<Entry> entries = new ArrayList<>();
    for (int i = mLeftIndex + para - 1; i <= mLastIndex; i++) {
        Entry entry = generateMALineDataEntry(i, para - 1);
        entries.add(entry);
    }
    LineDataSet set = new LineDataSet(entries, label);
    set.setColor(color);
    set.setLineWidth(0.7f);
    set.setDrawCircles(false);
    set.setDrawCircleHole(false);
    set.setDrawValues(false);
    set.setHighlightEnabled(false);
    set.setAxisDependency(YAxis.AxisDependency.LEFT);
    return set;
}
 
Example 4
Source File: CombinedChartActivity.java    From Stayfit with Apache License 2.0 6 votes vote down vote up
private LineData generateLineData() {

        LineData d = new LineData();

        ArrayList<Entry> entries = new ArrayList<Entry>();

        for (int index = 0; index < itemcount; index++)
            entries.add(new Entry(getRandom(15, 10), index));

        LineDataSet set = new LineDataSet(entries, "Line DataSet");
        set.setColor(Color.rgb(240, 238, 70));
        set.setLineWidth(2.5f);
        set.setCircleColor(Color.rgb(240, 238, 70));
        set.setCircleRadius(5f);
        set.setFillColor(Color.rgb(240, 238, 70));
        set.setDrawCubic(true);
        set.setDrawValues(true);
        set.setValueTextSize(10f);
        set.setValueTextColor(Color.rgb(240, 238, 70));

        set.setAxisDependency(YAxis.AxisDependency.LEFT);

        d.addDataSet(set);

        return d;
    }
 
Example 5
Source File: LineChartActivityColored.java    From StockChart-MPAndroidChart with MIT License 6 votes vote down vote up
private LineData getData(int count, float range) {

        ArrayList<Entry> values = new ArrayList<>();

        for (int i = 0; i < count; i++) {
            float val = (float) (Math.random() * range) + 3;
            values.add(new Entry(i, val));
        }

        // create a dataset and give it a type
        LineDataSet set1 = new LineDataSet(values, "DataSet 1");
        // set1.setFillAlpha(110);
        // set1.setFillColor(Color.RED);

        set1.setLineWidth(1.75f);
        set1.setCircleRadius(5f);
        set1.setCircleHoleRadius(2.5f);
        set1.setColor(Color.WHITE);
        set1.setCircleColor(Color.WHITE);
        set1.setHighLightColor(Color.WHITE);
        set1.setDrawValues(false);

        // create a data object with the data sets
        return new LineData(set1);
    }
 
Example 6
Source File: CombinedChartActivity.java    From StockChart-MPAndroidChart with MIT License 6 votes vote down vote up
private LineData generateLineData() {

        LineData d = new LineData();

        ArrayList<Entry> entries = new ArrayList<>();

        for (int index = 0; index < count; index++)
            entries.add(new Entry(index + 0.5f, getRandom(15, 5)));

        LineDataSet set = new LineDataSet(entries, "Line DataSet");
        set.setColor(Color.rgb(240, 238, 70));
        set.setLineWidth(2.5f);
        set.setCircleColor(Color.rgb(240, 238, 70));
        set.setCircleRadius(5f);
        set.setFillColor(Color.rgb(240, 238, 70));
        set.setMode(LineDataSet.Mode.CUBIC_BEZIER);
        set.setDrawValues(true);
        set.setValueTextSize(10f);
        set.setValueTextColor(Color.rgb(240, 238, 70));

        set.setAxisDependency(YAxis.AxisDependency.LEFT);
        d.addDataSet(set);

        return d;
    }
 
Example 7
Source File: StatisticsFragment.java    From HeartBeat with Apache License 2.0 5 votes vote down vote up
private LineData getWeekThoughtData() {
    LineData d = new LineData();

    ArrayList<Entry> entries = new ArrayList<>();

    for (int i=0; i<WEEK_COUNT; i++) {
        entries.add(
                new BarEntry(
                        new GetCountSpecDayApi(getActivity()).exec(
                                TimeUtils.calendarDaysBefore(WEEK_COUNT-i),
                                GetCountSpecDayApi.THOUGHT
                        ),i
                )
        );
    }

    LineDataSet set = new LineDataSet(entries, getString(R.string.thought_count_text));
    set.setColor(mAccentColor);
    set.setLineWidth(2.5f);
    set.setAxisDependency(YAxis.AxisDependency.LEFT);
    set.setCircleColor(mPrimaryColorDark);
    set.setCircleSize(5f);
    set.setFillColor(mPrimaryColor);
    set.setDrawValues(true);
    set.setValueFormatter(new IntValueFormatter());
    d.addDataSet(set);
    return d;
}
 
Example 8
Source File: ChartStatistics.java    From TwistyTimer with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Adds the main data set for all times and the data set for the progression of record best
 * times among all times. The progression of best times are marked in a different color to the
 * main line of all time using circles lined with a dashed line. This will appear to connect
 * the lowest troughs along the main line of all times.
 *
 * @param chartData The chart data to which to add the new data sets.
 * @param allLabel  The label of the all-times line.
 * @param allColor  The color of the all-times line.
 * @param bestLabel The label of the best-times line.
 * @param bestColor The color of the best-times line.
 */
private void addMainDataSets(LineData chartData, String allLabel, int allColor,
                             String bestLabel, int bestColor) {
    // Main data set for all solve times.
    final LineDataSet mainDataSet = createDataSet(allLabel, allColor);

    mainDataSet.setDrawCircles(getDrawCircle());
    mainDataSet.setCircleRadius(getCircleRadius());
    mainDataSet.setCircleColor(allColor);
    mainDataSet.setColor(getLineColor(allColor));

    chartData.addDataSet(mainDataSet);

    // Data set to show the progression of best times along the main line of all times.
    final LineDataSet bestDataSet = createDataSet(bestLabel, bestColor);

    bestDataSet.enableDashedLine(3f, 6f, 0f);

    bestDataSet.setDrawCircles(true);
    bestDataSet.setCircleRadius(BEST_TIME_CIRCLE_RADIUS_DP);
    bestDataSet.setCircleColor(bestColor);

    bestDataSet.setDrawValues(false);
    bestDataSet.setValueTextColor(bestColor);
    bestDataSet.setValueTextSize(BEST_TIME_VALUES_TEXT_SIZE_DP);
    bestDataSet.setValueFormatter(new TimeChartValueFormatter());

    chartData.addDataSet(bestDataSet);
}
 
Example 9
Source File: ChartRVAdapter.java    From batteryhub with Apache License 2.0 5 votes vote down vote up
private LineData loadData(ChartCard card) {
    // add entries to dataset
    LineDataSet lineDataSet = new LineDataSet(card.entries, null);
    lineDataSet.setMode(LineDataSet.Mode.LINEAR);
    lineDataSet.setDrawValues(false);
    lineDataSet.setDrawCircleHole(false);
    lineDataSet.setColor(card.color);
    lineDataSet.setCircleColor(card.color);
    lineDataSet.setLineWidth(1.8f);
    lineDataSet.setDrawFilled(true);
    lineDataSet.setFillColor(card.color);

    return new LineData(lineDataSet);
}
 
Example 10
Source File: PerformanceLineChart.java    From StockChart-MPAndroidChart with MIT License 5 votes vote down vote up
private void setData(int count, float range) {

        ArrayList<Entry> values = new ArrayList<>();

        for (int i = 0; i < count; i++) {
            float val = (float) (Math.random() * (range + 1)) + 3;
            values.add(new Entry(i * 0.001f, val));
        }

        // create a dataset and give it a type
        LineDataSet set1 = new LineDataSet(values, "DataSet 1");

        set1.setColor(Color.BLACK);
        set1.setLineWidth(0.5f);
        set1.setDrawValues(false);
        set1.setDrawCircles(false);
        set1.setMode(LineDataSet.Mode.LINEAR);
        set1.setDrawFilled(false);

        // create a data object with the data sets
        LineData data = new LineData(set1);

        // set data
        chart.setData(data);

        // get the legend (only possible after setting data)
        Legend l = chart.getLegend();
        l.setEnabled(false);
    }
 
Example 11
Source File: LineChartActivityColored.java    From Stayfit with Apache License 2.0 5 votes vote down vote up
private LineData getData(int count, float range) {

        ArrayList<String> xVals = new ArrayList<String>();
        for (int i = 0; i < count; i++) {
            xVals.add(mMonths[i % 12]);
        }

        ArrayList<Entry> yVals = new ArrayList<Entry>();

        for (int i = 0; i < count; i++) {
            float val = (float) (Math.random() * range) + 3;
            yVals.add(new Entry(val, i));
        }

        // create a dataset and give it a type
        LineDataSet set1 = new LineDataSet(yVals, "DataSet 1");
        // set1.setFillAlpha(110);
        // set1.setFillColor(Color.RED);

        set1.setLineWidth(1.75f);
        set1.setCircleRadius(3f);
        set1.setColor(Color.WHITE);
        set1.setCircleColor(Color.WHITE);
        set1.setHighLightColor(Color.WHITE);
        set1.setDrawValues(false);

        ArrayList<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();
        dataSets.add(set1); // add the datasets

        // create a data object with the datasets
        LineData data = new LineData(xVals, dataSets);

        return data;
    }
 
Example 12
Source File: LineChartTime.java    From StockChart-MPAndroidChart with MIT License 5 votes vote down vote up
private void setData(int count, float range) {

        // now in hours
        long now = TimeUnit.MILLISECONDS.toHours(System.currentTimeMillis());

        ArrayList<Entry> values = new ArrayList<>();

        // count = hours
        float to = now + count;

        // increment by 1 hour
        for (float x = now; x < to; x++) {

            float y = getRandom(range, 50);
            values.add(new Entry(x, y)); // add one entry per hour
        }

        // create a dataset and give it a type
        LineDataSet set1 = new LineDataSet(values, "DataSet 1");
        set1.setAxisDependency(AxisDependency.LEFT);
        set1.setColor(ColorTemplate.getHoloBlue());
        set1.setValueTextColor(ColorTemplate.getHoloBlue());
        set1.setLineWidth(1.5f);
        set1.setDrawCircles(false);
        set1.setDrawValues(false);
        set1.setFillAlpha(65);
        set1.setFillColor(ColorTemplate.getHoloBlue());
        set1.setHighLightColor(Color.rgb(244, 117, 117));
        set1.setDrawCircleHole(false);

        // create a data object with the data sets
        LineData data = new LineData(set1);
        data.setValueTextColor(Color.WHITE);
        data.setValueTextSize(9f);

        // set data
        chart.setData(data);
    }
 
Example 13
Source File: ListViewMultiChartActivity.java    From Stayfit with Apache License 2.0 5 votes vote down vote up
/**
 * generates a random ChartData object with just one DataSet
 * 
 * @return
 */
private LineData generateDataLine(int cnt) {

    ArrayList<Entry> e1 = new ArrayList<Entry>();

    for (int i = 0; i < 12; i++) {
        e1.add(new Entry((int) (Math.random() * 65) + 40, i));
    }

    LineDataSet d1 = new LineDataSet(e1, "New DataSet " + cnt + ", (1)");
    d1.setLineWidth(2.5f);
    d1.setCircleRadius(4.5f);
    d1.setHighLightColor(Color.rgb(244, 117, 117));
    d1.setDrawValues(false);
    
    ArrayList<Entry> e2 = new ArrayList<Entry>();

    for (int i = 0; i < 12; i++) {
        e2.add(new Entry(e1.get(i).getVal() - 30, i));
    }

    LineDataSet d2 = new LineDataSet(e2, "New DataSet " + cnt + ", (2)");
    d2.setLineWidth(2.5f);
    d2.setCircleRadius(4.5f);
    d2.setHighLightColor(Color.rgb(244, 117, 117));
    d2.setColor(ColorTemplate.VORDIPLOM_COLORS[0]);
    d2.setCircleColor(ColorTemplate.VORDIPLOM_COLORS[0]);
    d2.setDrawValues(false);
    
    ArrayList<ILineDataSet> sets = new ArrayList<ILineDataSet>();
    sets.add(d1);
    sets.add(d2);
    
    LineData cd = new LineData(getMonths(), sets);
    return cd;
}
 
Example 14
Source File: ProcessViewer.java    From PowerFileExplorer with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates an instance for {@link LineDataSet} which will store the entries
 * @return
 */
private LineDataSet createDataSet() {
    LineDataSet lineDataset = new LineDataSet(new ArrayList<Entry>(), null);

    lineDataset.setLineWidth(1.75f);
    lineDataset.setCircleRadius(5f);
    lineDataset.setCircleHoleRadius(2.5f);
    lineDataset.setColor(Color.WHITE);
    lineDataset.setCircleColor(Color.WHITE);
    lineDataset.setHighLightColor(Color.WHITE);
    lineDataset.setDrawValues(false);
    lineDataset.setCircleColorHole(accentColor);

    return lineDataset;
}
 
Example 15
Source File: StatisticActivity.java    From memorize with MIT License 5 votes vote down vote up
private LineData generateDataLine(int cnt) {

        ArrayList<Entry> values1 = new ArrayList<>();

        for (int i = 0; i < 12; i++) {
            values1.add(new Entry(i, (int) (Math.random() * 65) + 40));
        }

        LineDataSet d1 = new LineDataSet(values1, "New DataSet " + cnt + ", (1)");
        d1.setLineWidth(2.5f);
        d1.setCircleRadius(4.5f);
        d1.setHighLightColor(Color.rgb(244, 117, 117));
        d1.setDrawValues(false);

        ArrayList<Entry> values2 = new ArrayList<>();

        for (int i = 0; i < 12; i++) {
            values2.add(new Entry(i, values1.get(i).getY() - 30));
        }

        LineDataSet d2 = new LineDataSet(values2, "New DataSet " + cnt + ", (2)");
        d2.setLineWidth(2.5f);
        d2.setCircleRadius(4.5f);
        d2.setHighLightColor(Color.rgb(244, 117, 117));
        d2.setColor(ColorTemplate.VORDIPLOM_COLORS[0]);
        d2.setCircleColor(ColorTemplate.VORDIPLOM_COLORS[0]);
        d2.setDrawValues(false);

        ArrayList<ILineDataSet> sets = new ArrayList<>();
        sets.add(d1);
        sets.add(d2);

        return new LineData(sets);
    }
 
Example 16
Source File: TrafficFragment.java    From gito-github-client with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("deprecation")
private void chartDataSetStyling(LineDataSet dataSet) {
    dataSet.setAxisDependency(YAxis.AxisDependency.LEFT);
    dataSet.setColor(SettingsActivity.ThemePreferenceFragment.isLight(getContext()) ?
            getResources().getColor(R.color.traffic_chart_line_color_light) :
            getResources().getColor(R.color.traffic_chart_line_color_dark));
    dataSet.setLineWidth(2f);
    dataSet.setCircleRadius(4f);
    dataSet.setDrawValues(false);
    dataSet.setDrawCircleHole(false);
    dataSet.setCircleColor(SettingsActivity.ThemePreferenceFragment.isLight(getContext()) ?
            getResources().getColor(R.color.traffic_chart_line_color_light) :
            getResources().getColor(R.color.traffic_chart_line_color_dark));
}
 
Example 17
Source File: ProgressFragment.java    From voice-pitch-analyzer with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
    public void onViewCreated(View view, Bundle savedInstanceState)
    {
        CombinedChart chart = (CombinedChart) view.findViewById(R.id.progress_chart);
        this.recordings = new RecordingList(this.getContext());

        if (this.recordings != null)
        {
            List<String> dates = this.recordings.getDates();

            CombinedData data = new CombinedData(dates);

            LineDataSet dataSet = new LineDataSet(this.recordings.getGraphEntries(), getResources().getString(R.string.progress));
            LineData lineData = new LineData(dates, dataSet);
            BarData barData = new BarData(dates, GraphLayout.getOverallRange(this.getContext(), dates.size()));

            dataSet.setDrawCubic(true);
            dataSet.enableDashedLine(10, 10, 0);
            dataSet.setLineWidth(3f);
            dataSet.setDrawValues(false);

            dataSet.setCircleColor(getResources().getColor(R.color.canvas_dark));
            dataSet.setColor(getResources().getColor(R.color.canvas_dark));
            dataSet.setCircleSize(5f);

            dataSet.setCubicIntensity(0.05f);
            dataSet.setAxisDependency(YAxis.AxisDependency.LEFT);

            data.setData(lineData);
            data.setData(barData);
            chart.setData(data);
            GraphLayout.FormatChart(chart);

            chart.setTouchEnabled(true);
//            chart.setScaleEnabled(true);
            chart.setPinchZoom(true);
//            chart.setDoubleTapToZoomEnabled(true);

            chart.setDrawValueAboveBar(false);
            chart.setDrawOrder(new DrawOrder[]{
                    DrawOrder.BAR,
                    DrawOrder.BUBBLE,
                    DrawOrder.CANDLE,
                    DrawOrder.LINE,
                    DrawOrder.SCATTER
            });
        }

        super.onViewCreated(view, savedInstanceState);
    }
 
Example 18
Source File: DrawChartActivity.java    From Stayfit with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {

    switch (item.getItemId()) {
        case R.id.actionToggleValues: {
            List<ILineDataSet> sets = mChart.getData()
                    .getDataSets();

            for (ILineDataSet iSet : sets) {

                LineDataSet set = (LineDataSet) iSet;
                set.setDrawValues(!set.isDrawValuesEnabled());
            }

            mChart.invalidate();
            break;
        }
        case R.id.actionToggleHighlight: {
            if(mChart.getData() != null) {
                mChart.getData().setHighlightEnabled(!mChart.getData().isHighlightEnabled());
                mChart.invalidate();
            }
            break;
        }
        case R.id.actionTogglePinch: {
            if (mChart.isPinchZoomEnabled())
                mChart.setPinchZoom(false);
            else
                mChart.setPinchZoom(true);

            mChart.invalidate();
            break;
        }
        case R.id.actionToggleAutoScaleMinMax: {
            mChart.setAutoScaleMinMaxEnabled(!mChart.isAutoScaleMinMaxEnabled());
            mChart.notifyDataSetChanged();
            break;
        }
        case R.id.actionSave: {
            // mChart.saveToGallery("title"+System.currentTimeMillis());
            mChart.saveToPath("title" + System.currentTimeMillis(), "");
            break;
        }
    }
    return true;
}
 
Example 19
Source File: CalibrationLinearityActivity.java    From NoiseCapture with GNU General Public License v3.0 4 votes vote down vote up
private void updateLineChart() {
    LineChart lineChart = getLineChart();
    if(lineChart == null) {
        return;
    }
    if(freqLeqStats.isEmpty()) {
        return;
    }
    float YMin = Float.MAX_VALUE;
    float YMax = Float.MIN_VALUE;

    ArrayList<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();

    // Read all white noise values for indexing before usage
    int idStep = 0;
    double referenceLevel = freqLeqStats.get(0).whiteNoiseLevel.getGlobaldBaValue();
    for(LinearCalibrationResult result : freqLeqStats) {
        ArrayList<Entry> yMeasure = new ArrayList<Entry>();
        int idfreq = 0;
        for (LeqStats leqStat : result.measure) {
            float dbLevel = (float)leqStat.getLeqMean();
            YMax = Math.max(YMax, dbLevel);
            YMin = Math.min(YMin, dbLevel);
            yMeasure.add(new Entry(dbLevel, idfreq++));
        }
        LineDataSet freqSet = new LineDataSet(yMeasure, String.format(Locale.getDefault(),"%d dB",
                (int)(result.whiteNoiseLevel.getGlobaldBaValue() - referenceLevel)));
        freqSet.setColor(ColorTemplate.COLORFUL_COLORS[idStep % ColorTemplate.COLORFUL_COLORS.length]);
        freqSet.setFillColor(ColorTemplate.COLORFUL_COLORS[idStep % ColorTemplate.COLORFUL_COLORS.length]);
        freqSet.setValueTextColor(Color.WHITE);
        freqSet.setCircleColorHole(ColorTemplate.COLORFUL_COLORS[idStep % ColorTemplate.COLORFUL_COLORS.length]);
        freqSet.setDrawValues(false);
        freqSet.setDrawFilled(true);
        freqSet.setFillAlpha(255);
        freqSet.setDrawCircles(true);
        freqSet.setMode(LineDataSet.Mode.LINEAR);
        dataSets.add(freqSet);
        idStep++;
    }


    ArrayList<String> xVals = new ArrayList<String>();
    double[] freqs = FFTSignalProcessing.computeFFTCenterFrequency(AudioProcess.REALTIME_SAMPLE_RATE_LIMITATION);
    for (double freqValue : freqs) {
        xVals.add(Spectrogram.formatFrequency((int)freqValue));
    }

    // create a data object with the datasets
    LineData data = new LineData(xVals, dataSets);
    lineChart.setData(data);
    YAxis yl = lineChart.getAxisLeft();
    yl.setAxisMinValue(YMin - 3);
    yl.setAxisMaxValue(YMax + 3);
    lineChart.invalidate();
}
 
Example 20
Source File: StatActivity.java    From ankihelper with GNU General Public License v3.0 4 votes vote down vote up
private void drawLastDaysChart(int[][] data) {
    List<Entry> lookupEntries = new ArrayList<>();
    List<Entry> cardaddEntries = new ArrayList<>();
    for(int i = 0; i < data[0].length; i ++){
        lookupEntries.add(new Entry(i, data[1][i]));
        cardaddEntries.add(new Entry(i, data[2][i]));
    }
    if(lookupEntries.size() <= 1){
        mLastDaysChart.setVisibility(View.INVISIBLE);
    }else{
        mLastDaysChart.setVisibility(View.VISIBLE);
    }
    float lineWidth = 2;
    LineDataSet lineDataSet2 = new LineDataSet(lookupEntries, "Lookups");
    lineDataSet2.setColor(DARK_PINK);
    lineDataSet2.setLineWidth(lineWidth);
    lineDataSet2.setMode(LineDataSet.Mode.HORIZONTAL_BEZIER);
    lineDataSet2.setDrawCircles(false);
    lineDataSet2.setDrawValues(false);
    LineDataSet lineDataSet3 = new LineDataSet(cardaddEntries, "Cards");
    lineDataSet3.setColor(DARK_GREEN);
    lineDataSet3.setLineWidth(lineWidth);
    lineDataSet3.setMode(LineDataSet.Mode.HORIZONTAL_BEZIER);
    lineDataSet3.setDrawCircles(false);
    lineDataSet3.setDrawValues(false);
    List<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();
    dataSets.add(lineDataSet2);
    dataSets.add(lineDataSet3);
    mLastDaysChart.setData(new LineData(dataSets));
    mLastDaysChart.getDescription().setText("");
    //mHourChart.getDescription().setTextAlign();
    mLastDaysChart.getXAxis().setDrawGridLines(false);
    mLastDaysChart.getXAxis().setPosition(XAxis.XAxisPosition.BOTTOM);
    mLastDaysChart.getAxisRight().setEnabled(false);
    //mHourChart.getAxisLeft().setDrawGridLines(false);
    mLastDaysChart.getXAxis().setValueFormatter(
            new IAxisValueFormatter() {
                @Override
                public String getFormattedValue(float value, AxisBase axis) {
                    return  + ((int)(-mLastDays + value + 1)) + "d";
                }
            }
    );
    mLastDaysChart.getLegend().setPosition(Legend.LegendPosition.BELOW_CHART_CENTER);
    mLastDaysChart.invalidate();
}