[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.

    [img_1 : Building usage assignment in the Inspector and Reports tab]
    [img_1 : Building usage assignment in the Inspector and Reports tab]

    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.

    [img_2 : The Add a Chart button in the Dashboard panel]
    [img_2 : The Add a Chart button in the Dashboard panel]

    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.

    [img_3 : Chart configuration settings]
    [img_3 : Chart configuration settings]

    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.

    [img_4 : Selecting Building Area for the Bar Chart]
    [img_4 : Selecting Building Area for the Bar Chart]

    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.

    [img_5 : Visualized Bar Chart result]
    [img_5 : Visualized Bar Chart result]

    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.

    [img_6 : Pie Chart showing usage ratios]
    [img_6 : Pie Chart showing usage ratios]

    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.

    [img_7 : Setting up the Floor Area report card]
    [img_7 : Setting up the Floor Area report card]
    [img_8 : Total Floor Area results by usage]
    [img_8 : Total Floor Area results by usage]

    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.

    [img_9 : Using the Divide by function for averages]
    [img_9 : Using the Divide by function for averages]

    Now you can see the average floor area grouped by architectural usage.

    [img_10 : Average floor area chart result]
    [img_10 : Average floor area chart result]

    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.

    Previous Post
    Next Post
    Related Posts
    "Our job is not to tell people what to do, but to tell them what to think about."
    — Andrew Marshall, Empire's Strategist

    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.

    Continue Learning
    Explore complete tutorial collections for CityEngine and Global Mapper.

    Comments

    Popular posts from this blog

    029] How to Split Polygon Areas with Intersecting Lines in Global Mapper

    [008] How to Understand CGA Rule Structure in CityEngine (Beginner Guide)

    046] How to Create Parallel Offset Lines in Global Mapper