ActiveReports 19 .NET Edition
Report Authors / Report Controls / Report Controls in Page/RDLX Report / Chart / Plots / Funnel and Pyramid Charts / Create Pyramid Chart
In This Topic
    Create Pyramid Chart
    In This Topic

    This walkthrough creates a Clustered Pyramid Chart. The chart shows the hierarchical structure of employees in an organization, which is depicted in the form of discrete vertical pyramids. The final chart appears like this:

    Pyramid Chart

    Create a Report and Bind Report to Data

    In the ActiveReports Designer, create a new RDLX report and follow the New Report wizard to bind the report to data. You can also perform data binding later using the Report Data Source dialog accessed from the Report Explorer.

    Connect to a Data Source

    1. In the Report Data Source dialog, select the General page and enter the name of the data source.
    2. Under Type, select 'Json Provider'.
    3. Go to the Content tab under Connection and set the type of JSON data to 'Embedded'.
    4. In the Select or type the file name or URL or enter the data to be embedded field, enter the following data:

      JSON Data

      Copy Code
      {
         "data":{
            "Counts":[
               {
                  "Title":"Managers",
                  "Layer":4,
                  "Count":15
               },
               {
                  "Title":"Sr. VPs",
                  "Layer":2,
                  "Count":3
               },
               {
                  "Title":"Directors",
                  "Layer":3,
                  "Count":8
               },
               {
                  "Title":"Developers",
                  "Layer":6,
                  "Count":23
               },
               {
                  "Title":"CEO",
                  "Layer":1,
                  "Count":1
               },
               {
                  "Title":"Sr. Developers",
                  "Layer":5,
                  "Count":10
               },
               {
                  "Title":"Jr. Developers",
                  "Layer":7,
                  "Count":11
               }
            ]
         }
      }
      
      For more information, see the JSON Provider topic.
    5. Go to the Connection String tab and verify the generated connection string by clicking the Validate DataSource Validate Data Source icon.
    6. Click OK to save the changes and open the DataSet dialog.

    Add a Dataset   

    1. In the Dataset dialog, select the General page and enter the name of the dataset, 'OrgDS'.
    2. Go to the Query page and enter the following query to fetch the required fields:
      Query
      Copy Code
      $.data.Counts[*]
         
    3. Click OK to complete adding the dataset.

    Create Basic Structure of Chart

    We will use the Chart Wizard dialog to configure chart data values and basic customization. If you have a dataset added to your report, on Chart's drag-drop operation, the wizard appears. See the topic on Chart Wizard for more information. You can make further adjustments to the chart after you exit the wizard by accessing the properties of chart elements through dialogs, property panels, and adorners.

    1. Drag-drop Chart data region onto the design area. The New Chart dialog appears with an option to select the query and the plot type.
    2. Select the Query as the dataset name (OrgDs) and the Plot Type as 'Pyramid'.
    3. Click Next to configure data values.
    4. Under Configure Chart Data Values, set the field, aggregate, and caption as shown below, and click Next.    
      Field Aggregate Caption
      [Count] Sum Count
    5. In the Configure Chart Data Groupings, set Series > Group By to [Title] and Layout Type to 'Stack'.
    6. Click Next and Choose Report Colors from Theme and Style, and preview your chart. 
          Pyramid Chart

      Now that the basic structure of your chart is ready, let us add more meaning to the chart using the properties via the Chart Panels, Adorners, and Property Panel.

    Add Customizations to Chart

    Series Groups

    1. In the Series Groups area, right-click [Title] and from the adorner, click Edit.
    2. In the Chart Data - Series Groups dialog, go to the Sorting tab, and add an Expression as[Layer] and Direction as 'Descending'.
    3. Click OK to close the dialog.

    Legend

    1. In the Legend Data, right-click Color and from the adorner, click Edit.    
    2. Go to the Layout page and set the Orientation to 'Horizontal' and Position to 'Bottom'.
    3. Click OK to save the settings.

    Y-Axis

    1. To open the smart panel, right-click 'Y Axis' from the Report Explorer and choose Property Dialog.
    2. Go to the Title page and remove the text from the Title field to hide the Y-axis title in the chart.
    3. Go to the Labels page > General tab and uncheck the Show Labels option to hide the data labels.
    4. Go to the Line page and uncheck the Show Line option.
    5. Go to the Major Gridline page and uncheck the Show grid option to hide the gridlines.
    6. Click OK to complete setting up the Y-axis.

    X-Axis

    1. To open the smart panel, right-click 'X Axis' on the Report Explorer and choose Property Dialog.
    2. Go to the Title page and remove the text from the Title field to hide the X-axis title in the chart.
    3. Go to the Labels page and uncheck the Show Labels option to hide the data labels.
    4. Go to the Line page and uncheck the Show Line option.
    5. Click OK to complete setting up the X-axis.

    Chart Palette

    1. To open the smart panel, right-click 'Chart' on the Report Explorer and choose Property Dialog.
    2. Go to the Palette page and select the 'Flatly' palette.
    3. Click OK to complete setting up the chart palette.

    Header

    1. To open the smart panel for the chart header, right-click 'Header' on the Report Explorer and choose Property Dialog.
    2. Go to the General page and set Title to 'Organization Structure'.
    3. Go to the Font page and set the properties as below.
      • Size: 20pt
      • Color: DimGray
    4. Click OK to complete setting up the chart header.
      You may want to resize the chart, change the chart palette, and customize other chart elements. Once you are done, press F5 to preview the report.
                 
      Note: We use stub data at design time and not real data. So to view the actual final chart, you need to view the chart on preview.