The original and popular Chartmaker extension has been in use by AI2 developers for years, and has provided a quick method to generate simple charts for pie, bar or line.
This extension is a complete rewrite of the original, builds on what was there, and offers many new features:
- two new charts: column and table
- a boolean to turn zoom on and off
- exposes the ability to add other options
- simplifies data compilation - straightforward and user-friendly lists of lists
- returns selected data to the app through the webviewstring
- works with the custom webview extension
- multi bar and column charts now possible
- under the hood, deletes the chart html once chart is rendered
The extension uses "classic" google charts, the material charts on offer are less featureful.
- Latest Version: 1.0
- Tested: This has been tested on App Inventor 2 using Android 10 and 11 devices, companion 2.60, and compiled apk. It may work on other derivatives....
- Released: 2021-07-02T23:00:00Z
- Last Updated:2021-07-02T23:00:00Z
- Built: Using the Rush Extension Builder by @Shreyash
I could write a book about how you might use this, the configuration options for google charts appear to be endless (which is why Mills College did such a good job of keeping it simple!). In essence all chart blocks require a webviewer, a data table, and a selection for whether the user wants the chart to zoom on the screen when dragged (the plus and minus zoom buttons). After that it is about configuration. For each chart I have shown a few ideas of what can be done, and provided a link to the specific documentation for each chart. Syntax is important.
- Pie Chart
- Table Chart
- Bar Chart
If you test the aia, you will see that this chart is also animated. The data blocks are for the second chart, and show how to set the colour of the bars for a single row of data.
- Column Chart
- Line Chart
- Using Custom Webview
You will need to bring in the custom webview extension, Below are the blocks required to show a pie chart (you will also need the custom webview webviewstring change block to get data feedback):
The order of the blocks is important...
7. Bits and Bobs
- Also see Strings and Numbers further down for information about handling numbers as strings in the
Enjoy :D, and all feedback and comments welcome.
Available for use in any MIT AppInventor projects or competitions