3 Updates to mBlock Data Chart Block Extension

We are constantly working to improve your mBlock experience. As you might know, mBlock has many block extensions such as Cognitive Services, Teachable machine, AI service, etc. to bring more fun for coding learning.

In order to provide more possibilities for teaching and learning data science, recently we’ve updated mBlock Data Chart Extension by supporting uploading data from.CSV file, chart rendering speed control, and adding new chart types (dual-axis chart and pie chart).

The main content includes:

  • Why updated mBlock Data Chart Extension
  • 3 Updates to mBlock Data Chart Block Extension
    • Upload data from.CSV file
    • Chart rendering speed control
    • New chart types: dual-axis chart and pie chart
  • Case Study: One-week temperature of New York
Data Chart Extension - Illustration

Why updated mBlock Data Chart Extension

With the advent of the era of big data, all sorts of complicated data are beginning to flood our lives. And turning data into charts can allow people to use and manage huge amounts of data more efficiently.

In the future, the introduction of data charts in programming instruction will allow students to expand their knowledge of data processing and guide them in visualizing various types of data. It will also help them improve their understanding of data science and lay the foundation for future data analysis.

(Image from the web)

3 Updates to mBlock Data Chart Block Extension

1.Upload data from.CSV file

In addition to collecting data in real-time, Data Chart Extension now supports uploading data from.CSV file. By clicking "Import", we can directly upload our data in.CSV file, so that you can learn data collection, data import, data processing, data visualization all in one place.

2.Chart rendering speed control

Previously, the data charts in mBlock were directly presented after visualization, hence you couldn’t see how fast or slow the growth or decrease was.

But after the update, now mBlock supports rendering speed control, and we can choose how fast or slow to render the chart.

3. Add new chart types: dual-axis chart and pie chart

In the update, we’ve added dual-axis chart and pie chart. Now mBlock has 4 types of charts in mBlock Data Chart Extension (Line chart, bar chart, dual axis chart and pie chart)

Case Study: Relation between temperature and humidity

Below we will show you a simple example of how a data chart works. We're going to give you a demonstration around " Relation between temperature and humidity"

Step 1)Add data chart blocks

  • Select "Panda" under "Sprites" and click "Add Extension" in the blocks area.
  • Add "Data Chart" in the pop-up Extension Center page.

Step 2Create variables(X and Y)for the chart

  • Make X and Y variables in “Variable” block

Step 3Use data chart blocks to create a chart

  • Drag and drop the two data chart blocks to the script area: "open data chart window" and "Set chart title ()"
  • Name the chart "Relation between temperature and humidity ".
  • Add block "Set chart type to" and select "Line Chart" from the drop-down menu.
  • Set the x-axis as “date” and the y-axis to “temperature/ ℃”
  • Name the y-axis on the right as “humidity/%”

Set data group including the highest, lowest temperature and humidity.

Step 4Input data group

Now start inputting data. We enter the following data into the program to generate a dual axis chart.

Drag and drop “input data to (): x () y ()” block and manually input the data in the form.

  • Quickly add 3*5 “input data to (): x () y ()” via copy-paste from the right-click menu. Enter the highest, lowest temperature and humidity data from Monday to Friday.

Step 5Add an event to trigger the data chart.

Add an event block "When the green flag is clicked" and place it at the top.

Then click on the green banner at the bottom of the stage to trigger the chart to display.

Above is a demo example of manual data entry. If you have data that has already been processed in a .CSV file, you can import the data by clicking “Import” and the data chart will the generated.

Check out the data chart user guide here >>

We will continue to improve mBlock to provide the best user experience. Please let us know in the Makeblock forum if you have any feedback.

admin

The user is lazy, not fill in his Biographical Info.