Android Tutorial 💡 [B4X] [XUI] [B4XPages] B4A recreating Google Trends results with xCharts - Newer developers

Peter Simpson

Licensed User
Hello to you all,
Here is an extremely simple example on how to easily recreate Google Trends results using B4XPages with B4A and the xChart library. In this example I used Google Trends to search for five different search terms (I started with vehicle manufacturers but the results were disappointing) and I exported the results as a CSV file. Google Trends shows you two charts on one screen, the CSV file has the necessary data to recreate the charts using the excellent xChart library.

I've tried to make the code as simple as possible to follow for new to B4X developers, I've included two ways to populate the charts (with and without a For loop). The code in B4XMainPage is cross platform and works with B4A, B4i and also B4J, I've added comments where feasible to do so.

>>> CLICK HERE <<< to download the B4XPages source code.

B4i and B4J projects

Libraries needed:

Android screenshots below:

xCharts recreating Google Trends results without figures


xCharts recreating Google Trends results with figures

Below is the screenshot from the original Google Trends search results

Last edited: