[020] How to Create Dashboard Charts from Report Data in CityEngine
Leverage + Visualizing + Urban Statistics summary
This tutorial explores how to use the CityEngine Dashboard to transform raw CGA report data into intuitive Bar and Pie charts, allowing for immediate urban density and land-use analysis.
Let's take a brief look at how to create charts using the Dashboard feature in CityEngine. The Dashboard is a powerful tool that provides visual feedback as you modify your procedural models.
To follow along, we will use a CGA rule that generates random building heights, separates floors, and extracts necessary data into the Reports tab. Below is the code used for this workflow.
CGA Code for Data Extraction
attr BD_floor = rint(rand(1,8))
# Generates a random floor count between 1 and 8.
attr BD_use = ""
# Specify the building usage (e.g., School, Factory, Hospital) in the Inspector panel.
Lot -->
report("Building Area." + BD_use, geometry.area())
# Accumulates the building footprint area based on the usage type.
extrude(BD_floor*3) BD
# Extrudes the height based on the floor count (3m height per floor).
BD --> split(y){3 : Floor}*
# Splits the building into individual 3m floor segments.
Floor -->
report("Floor Count." + BD_use, 1)
# Accumulates the number of floors by usage.
report("Floor Area." + BD_use, geometry.area())
# Accumulates the area of each floor by usage.
comp(f){front : front_Facade | side : side_Facade}
# Separates the front facade from the side facades.
front_Facade -->
report("Front Elevation Area." + BD_use, geometry.area())
# Accumulates the area of the front elevation by usage.
color(1,0,0)
# Colors the front facade red.
X.
side_Facade -->
color(0,1,0)
# Colors the other sides green.
X.
Step 1: Assigning Building Usage
Once you have applied the rule to your shapes, select specific buildings and define their categories (School, Factory, Hospital, Shop, etc.) in the BD_use field within the Inspector panel.
If you see information being generated by usage in the Reports tab (similar to the image above), you have successfully set up the data extraction logic.
Step 2: Creating a Bar Chart
Now, let's use the Dashboard to draw a simple graph. Go to the top menu and select Window -> Dashboard to open the panel. In the Dashboard panel, click the Add a Chart button.
A configuration window like the one below will appear. There are many options here, but most are intuitive enough to understand just by looking at them.
To check the building area by usage as a bar graph, follow these settings:
Select Bar Chart, then choose Building Area.* from the
Report items. Finally, click Add Card.
The chart is generated as shown below. You can resize it by clicking the triangle at the bottom right of the card. If you hover your mouse over any bar, the specific value for that category will be displayed.
Step 3: Creating a Pie Chart
You can repeat the same process to create a Pie Chart. Simply select "Pie Chart" as the type. The Pie Chart is useful because it automatically shows the percentage that each usage type occupies relative to the total area.
Step 4: Calculating Total Floor Area (GFA)
Next, let's calculate the Gross Floor Area (GFA) by building usage. By
choosing Floor Area.*, you can see the total accumulated area of
all floors for each usage type.
Step 5: Advanced Charts (Average Area per Floor)
You can also create more complex metrics, such as the
Average Area per Floor for each usage. Select Bar Chart, choose
Floor Area.* for the Report, and use the Divide by field
to select Floor Count.*. Click Add Card to finalize.
Now you can see the average floor area grouped by architectural usage.
Dashboard Limitations and Tips
As we've explored, you can create various useful charts simply by setting up
report() commands within your CGA code. One important thing to
note is that the
Dashboard does not save your chart configurations permanently. Just
like the Facade Wizard, the contents are visible only while the panel is open;
once closed, the setup is gone.
Additionally, CityEngine does not currently support exporting these charts directly. If you need them for a formal report, you will need to take a screen capture. For those who are proficient with spreadsheets, I recommend copying the text data from the Reports tab and working within Excel or Google Sheets for more advanced formatting.
A key advantage is that as your 3D model changes, the Dashboard updates automatically, providing immediate feedback on your design's statistical impact.
Tutorial Video
In our next lesson, we will look at how to reference other CGA rule files. This is a very useful technique when building libraries of reusable rules. After that, we will cover the Bridge and SketchUp Extension, which will mostly conclude our interface walkthrough.
- Learn how to generate building reports in [019] How to Generate Real-Time Building Reports in CityEngine Using CGA
- Continue learning rule management in [021] Import External CGA Files for Modular Rule Design in CityEngine
- Understand CGA hierarchy concepts in [008] How to Understand CGA Rule Structure in CityEngine
- Learn attribute-based control in [004] How to Color Building by Attribute in Esri CityEngine
As procedural designers, the data we visualize should not just be a static result. It should serve as a prompt for deeper reflection on urban form and function. The CityEngine Dashboard is where our models begin to speak the language of analysis.
Comments
Post a Comment
Feel free to leave a comment if you have any questions about Global Mapper or CityEngine. I will get back to you with a sincere response as soon as possible. (Please note that all comments are moderated and manually approved to maintain a high-quality community. Promotional or spam content will not be published.)