- Install
- Basic operation
- Basics of programming for electronic work
- Basics of programming for Excel
- Machine learning with scikit-learn
- Visualizing data with matplotlib
- Basic
- General chart
- Show a bar chart with only one series
- Show a bar chart with multiple series
- Draw a stacked bar chart
- Adding data labels to bar charts
- Show a line chart with only one series
- Show a line chart with multiple series
- Adding data labels to line charts
- Show a pie chart with only one series
- Show a pie chart with multiple series
- Statistical chart
- Web programming
- RPA programming
- Miscellaneous programming
- Reference
Show a bar chart with only one series
This page explains how to display a simple bar graph with only one series.
1. Create the source data for the chart
Enter the source data for the chart into an Excel worksheet.
As shown in the image below, enter the values to be used as labels for the X-axis and the values to be displayed as a bar chart.

2. Adding blocks
Add the minimum necessary blocks by following the steps on the "Create and show chart" page.
Then, add a block to display a bar chart between the chart initialization and chart display blocks.
This block is long horizontally, so it may be difficult to use if the screen width is narrow.
In that case, right-click the block and click "External input" in the menu to change it to a vertical shape.
You can also right-click a vertical block and click "Inline Input" in the menu to change it to a horizontal one.
3. Setting the source data for the chart
Use the cell range specification block in the "Excel" - "Cells" group to specify the cell range containing the data that will be the source of the chart with the "X" and "Y" parameters.
If you have entered the item name in the first row of the data, you can also enter the item name in the cell range with the "Y" parameter.
4. Formatting
You can set the format of the bar chart using parameters such as "Line width" and "Line type" for creating a bar chart.
The "Label" parameter specifies the label to be added to the bar chart series.
If you also include the item name in the cell range in the "Y" parameter, drag the "first value of Y" block in the "matplotlib" - "General chart" group to the "Label" parameter.
![]()
5. Example
Assume the data has been entered into Excel as in the example above.

In this case, specify cells A2 to A6 for the "X" parameter.
Specify cells B1 to B6 for the "Y" parameter, including the first item name.
In addition, drag the "First Y value" block to the "Label" parameter.
When you run this program, you will see the graph at the top of this page.
The file for this example can be downloaded from here.
The Excel data file used in this example can also be downloaded from here.
Before running this example, open the data file in Excel.