Closed HazyIAm closed 5 years ago
I'm trying to get thingspeak.com graphs on my mobile app that I am making. I am following: https://github.com/MacroYau/ThingSpeakAndroid This tells me that to get the graphs of the channel I have to use :
LineChartView chartView = (LineChartView) findViewById(R.id.chart); tsChart = new ThingSpeakLineChart(CHANNEL_ID, FIELD_ID); tsChart.setListener(new ThingSpeakLineChart.ChartDataUpdateListener() { @Override public void onChartDataUpdated(long channelId, int fieldId, String title, LineChartData lineChartData, Viewport maxViewport, Viewport initialViewport) { chartView.setLineChartData(lineChartData); chartView.setMaximumViewport(maxViewport); chartView.setCurrentViewport(initialViewport); } }); tsChart.loadChartData();
However I'm getting the error : "Cannot resolve symbol tsChart". Why is that? I have added the library and included all dependencies.
Found the solution.......
I'm trying to get thingspeak.com graphs on my mobile app that I am making. I am following: https://github.com/MacroYau/ThingSpeakAndroid This tells me that to get the graphs of the channel I have to use :
LineChartView chartView = (LineChartView) findViewById(R.id.chart); tsChart = new ThingSpeakLineChart(CHANNEL_ID, FIELD_ID); tsChart.setListener(new ThingSpeakLineChart.ChartDataUpdateListener() { @Override public void onChartDataUpdated(long channelId, int fieldId, String title, LineChartData lineChartData, Viewport maxViewport, Viewport initialViewport) { chartView.setLineChartData(lineChartData); chartView.setMaximumViewport(maxViewport); chartView.setCurrentViewport(initialViewport); } }); tsChart.loadChartData();
However I'm getting the error : "Cannot resolve symbol tsChart". Why is that? I have added the library and included all dependencies.