ActiveReports 19 .NET Edition
Report Authors / Report Controls / Report Controls in Page/RDLX Report / Chart / Plots / Gantt Chart / Create Gantt Chart
In This Topic
    Create Gantt Chart
    In This Topic

    This walkthrough creates a Gantt Chart to layout recommended child immunization schedule based on age in the United States. The schedule shows recommended vaccines at an acceptable age range, the number of doses, and highlights the recommendations for all children, catch-up vaccinations in case of missed vaccines, and other high-risk groups.

    Gantt 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
      [
       {
         "Vaccine": "Hepatitis B (HepB)",
         "Start": 0,
         "End": 1,
         "Dose": "1st Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Hepatitis B (HepB)",
         "Start": 1,
         "End": 3,
         "Dose": "2nd Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Hepatitis B (HepB)",
         "Start": 4,
         "End": 5,
         "Dose": "",
         "Range": "For catch-up immunization"
       },
       {
         "Vaccine": "Hepatitis B (HepB)",
         "Start": 6,
         "End": 18,
         "Dose": "3rd Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Hepatitis B (HepB)",
         "Start": 19,
         "End": 216,
         "Dose": "",
         "Range": "For catch-up immunization"
       },
       {
         "Vaccine": "Rotavirus (RV)",
         "Start": 2,
         "End": 3,
         "Dose": "1st Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Rotavirus (RV)",
         "Start": 4,
         "End": 5,
         "Dose": "2nd Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Rotavirus (RV)",
         "Start": 6,
         "End": 7,
         "Dose": "3rd Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Diptheria, Tetanus & Acellular pertussis (DTaP)",
         "Start": 2,
         "End": 3,
         "Dose": "1st Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Diptheria, Tetanus & Acellular pertussis (DTaP)",
         "Start": 4,
         "End": 5,
         "Dose": "2nd Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Diptheria, Tetanus & Acellular pertussis (DTaP)",
         "Start": 6,
         "End": 7,
         "Dose": "3rd Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Diptheria, Tetanus & Acellular pertussis (DTaP)",
         "Start": 9,
         "End": 12,
         "Dose": " ",
         "Range": "For catch-up immunization"
       },
       {
         "Vaccine": "Diptheria, Tetanus & Acellular pertussis (DTaP)",
         "Start": 15,
         "End": 18,
         "Dose": "4th Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Diptheria, Tetanus & Acellular pertussis (DTaP)",
         "Start": 18.5,
         "End": 48,
         "Dose": " ",
         "Range": "For catch-up immunization"
       },
       {
         "Vaccine": "Diptheria, Tetanus & Acellular pertussis (DTaP)",
         "Start": 48,
         "End": 84,
         "Dose": "5th Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Haemophilus Influenzae type b (Hib)",
         "Start": 2,
         "End": 3,
         "Dose": "1st Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Haemophilus Influenzae type b (Hib)",
         "Start": 4,
         "End": 5,
         "Dose": "2nd Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Haemophilus Influenzae type b (Hib)",
         "Start": 9,
         "End": 10,
         "Dose": "  ",
         "Range": "For catch-up immunization"
       },
       {
         "Vaccine": "Haemophilus Influenzae type b (Hib)",
         "Start": 12,
         "End": 16,
         "Dose": "3rd Dose or 4th Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Haemophilus Influenzae type b (Hib)",
         "Start": 18,
         "End": 36,
         "Dose": "",
         "Range": "For catch-up immunization"
       },
       {
         "Vaccine": "Haemophilus Influenzae type b (Hib)",
         "Start": 48,
         "End": 84,
         "Dose": " ",
         "Range": "For catch-up immunization"
       },
       {
         "Vaccine": "Haemophilus Influenzae type b (Hib)",
         "Start": 84,
         "End": 216,
         "Dose": " ",
         "Range": "For certain high-risks groups"
       },
       {
         "Vaccine": "Pneumococcal conjugate (PCV13)",
         "Start": 2,
         "End": 3,
         "Dose": "1st Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Pneumococcal conjugate (PCV13)",
         "Start": 4,
         "End": 5,
         "Dose": "2nd Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Pneumococcal conjugate (PCV13)",
         "Start": 6,
         "End": 7,
         "Dose": "3rd Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Pneumococcal conjugate (PCV13)",
         "Start": 9,
         "End": 10,
         "Dose": "  ",
         "Range": "For catch-up immunization"
       },
       {
         "Vaccine": "Pneumococcal conjugate (PCV13)",
         "Start": 12,
         "End": 16,
         "Dose": "4th Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Pneumococcal conjugate (PCV13)",
         "Start": 19,
         "End": 84,
         "Dose": "",
         "Range": "For catch-up immunization"
       },
       {
         "Vaccine": "Pneumococcal conjugate (PCV13)",
         "Start": 84,
         "End": 216,
         "Dose": " ",
         "Range": "For certain high-risks groups"
       },
       {
         "Vaccine": "Inactivated poliovirus (IPV)",
         "Start": 2,
         "End": 3,
         "Dose": "1st Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Inactivated poliovirus (IPV)",
         "Start": 4,
         "End": 5,
         "Dose": "2nd Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Inactivated poliovirus (IPV)",
         "Start": 6,
         "End": 18,
         "Dose": "3rd Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Inactivated poliovirus (IPV)",
         "Start": 18.1,
         "End": 48,
         "Dose": "",
         "Range": "For catch-up immunization"
       },
       {
         "Vaccine": "Inactivated poliovirus (IPV)",
         "Start": 48,
         "End": 84,
         "Dose": "4th Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Inactivated poliovirus (IPV)",
         "Start": 84,
         "End": 204,
         "Dose": "",
         "Range": "For catch-up immunization"
       },
       {
         "Vaccine": "Influenza (IIV)",
         "Start": 6,
         "End": 18,
         "Dose": "Annual vaccination 1 or 2 doses ",
         "Range": "For all children"
       },
       {
        "Vaccine": "Influenza (IIV)",
        "Start": 18,
        "End": 19,
        "Dose": " ",
        "Range": "For all children"
      },
       {
         "Vaccine": "Influenza (IIV)",
         "Start": 19,
         "End": 84,
         "Dose": "Annual vaccination 1 or 2 doses",
         "Range": "For all children"
       },
       {
         "Vaccine": "Influenza (IIV)",
         "Start": 96,
         "End": 216,
         "Dose": "Annual vaccination 1 dose only",
         "Range": "For all children"
       },
       {
        "Vaccine": "Measles, mumps, rubella (MMR)",
        "Start": 6,
        "End": 9,
        "Dose": " ",
        "Range": "For certain high-risks groups"
      },
       {
         "Vaccine": "Measles, mumps, rubella (MMR)",
         "Start": 12,
         "End": 16,
         "Dose": "1st Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Measles, mumps, rubella (MMR)",
         "Start": 18.1,
         "End": 48,
         "Dose": "  ",
         "Range": "For catch-up immunization"
       },
       {
         "Vaccine": "Measles, mumps, rubella (MMR)",
         "Start": 48,
         "End": 84,
         "Dose": "2nd Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Measles, mumps, rubella (MMR)",
         "Start": 84,
         "End": 216,
         "Dose": "",
         "Range": "For catch-up immunization"
       },
       {
         "Vaccine": "Varicella (VAR)",
         "Start": 12,
         "End": 16,
         "Dose": "1st Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Varicella (VAR)",
         "Start": 18.1,
         "End": 48,
         "Dose": "  ",
         "Range": "For catch-up immunization"
       },
       {
         "Vaccine": "Varicella (VAR)",
         "Start": 48,
         "End": 84,
         "Dose": "2nd Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Varicella (VAR)",
         "Start": 84,
         "End": 216,
         "Dose": "",
         "Range": "For catch-up immunization"
       },
       {
        "Vaccine": "Hepatitis A (HepA)",
        "Start": 6,
        "End": 9,
        "Dose": "  ",
        "Range": "For certain high-risks groups"
      },
       {
         "Vaccine": "Hepatitis A (HepA)",
         "Start": 12,
         "End": 18,
         "Dose": "2nd Dose Series",
         "Range": "For all children"
       },
       {
         "Vaccine": "Hepatitis A (HepA)",
         "Start": 18,
         "End": 23,
         "Dose": " ",
         "Range": "For all children"
       },
       {
         "Vaccine": "Hepatitis A (HepA)",
         "Start": 24,
         "End": 216,
         "Dose": "",
         "Range": "For catch-up immunization"
       },
       
       {
        "Vaccine": "Meningococcal (MenACWY)",
        "Start": 2,
        "End": 132,
        "Dose": " ",
        "Range": "For certain high-risks groups"
      },
       {
         "Vaccine": "Meningococcal (MenACWY)",
         "Start": 132,
         "End": 156,
         "Dose": "1st Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Meningococcal (MenACWY)",
         "Start": 156,
         "End": 180,
         "Dose": "   ",
         "Range": "For catch-up immunization"
       },
       {
         "Vaccine": "Meningococcal (MenACWY)",
         "Start": 180,
         "End": 191,
         "Dose": "2nd Dose",
         "Range": "For all children"
       },
       {
         "Vaccine": "Meningococcal (MenACWY)",
         "Start": 191,
         "End": 216,
         "Dose": "  ",
         "Range": "For catch-up immunization"
       }
      ]
      

      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 Chart Wizard, from the Select Data Set dialog, select a suitable Dataset name from the dropdown menu.
    2. Go to the Query page and enter the following query to fetch the required fields:
      Query
      Copy Code
      $.[*]
    3. Click OK to save the changes.

    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 (Stats)  and the Plot Type as 'Gantt'.
    3. Click Next to configure data values.
    4. Under Configure Chart Data Values, set the Start and End fields, aggregates, and captions as shown below, and click Next.    
      Field Aggregate Caption
      [Start] Min Start
      [End] Max End
    5. In the Configure Chart Data Groupings, set the Categories > Group By to [Vaccine].
    6. Set Series > Group By to [Dose]. Keep the remaining settings as it is.
    7. Click Next and Choose Report Colors from Theme and Style, and preview your chart.
         
                   Gantt 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

    Chart Data

    1. In the Chart Data area, right-click the Start, End and from the adorner, click Edit.
    2. In the Chart Data - Series Values dialog, go to Labels tab and set following under Point Labels:
      • Value: =[Dose]
      • Text Position: Center
    3. Click OK to close the dialog.

    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 set the following properties.
      • Title: Age (in months)
      • Font > Size: 10pt
      • Padding > Top: 4pt
      • Padding > Bottom: 4pt
    3. Go to the Layout page and set Position to 'Far'.
    4. Go to the Labels page > General, check-on Show Labels and set Format to 'n0'.    
    5. Go to the Labels page > Appearance tab and set the following properties.
      • Font > Size: 9pt
      • Font > Color: DimGray
    6. Go to the Line page and check the Show Line option. Set the color to 'Gainsboro'.
    7. Go to the Major Gridline page and set Grid appearance > Show Grid: Uncheck
    8. Go to the Scale page and set the following properties.
      • Scale Type: Linear
      • Minimum Scale value: 0
      • Maximum Scale value: 18
    9. 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 Layout page and check the Position > Reversed option to reverse the axis to appear from top to bottom.
    4. Go to the Labels page > General tab and check the Show Labels option to show the data labels.
    5. Go to the Labels page > Appearance tab and set the following properties.
      • Font > Size: 9pt
      • Font > Color: DimGray
    6. Go to the Line page and uncheck the Show Line option.
    7. Go to the Minor Gridline page and uncheck the Show Grid option to hide minor gridlines.
    8. Go to the Major Gridline page, check the Show Grid option, and set the Color to 'GainsBoro'.
    9. Click OK to complete setting up the X-axis.

    Chart Palette

    1. To open the smart panel for advanced chart settings, right-click 'Chart' on the Report Explorer and choose Property Dialog.
    2. Go to the Palette page and add these custom palette colors, #bfecb8, #9ebac4, and #ffb1ae.
    3. Click OK to complete setting up the chart palette.

    Legend   

    1. In the Legend Data, right-click Color and from the adorner, click Edit.
    2. Go to the General page and set Legend Series Data Field to  =[Range].
    3. Keep the Legend Mode as 'None'.
    4. Go to the Title page and set the title to 'Recommended age range' and Font > Size  to '12pt'.
    5. Go to the Appearance page and set the following properties.
      • Font > Size: 10pt
      • Font > Color: DimGray
    6. Go to the Layout page and set the following properties.
      • Position: Top
      • Orientation: Horizontal
    7. Click OK to complete setting up the Legend.

    Chart

    1. From the Report Explorer, select Chart.
    2. In the Properties panel, go to BarSettings > Overlap and set it to some percentage, say '98%'.

    Header

    1. To open the smart panel, right-click 'Header' on the Report Explorer and choose Property Dialog.
    2. Go to the General page and set Title to 'Child Immunization Schedule'.
    3. Set the Horizontal Alignment to Center and Vertical Alignment to Middle.
    4. Go to the Font page and set the properties as below.
      • Size: 20pt
      • Color: #3da7a8
    5. Click OK to complete setting up the chart header.
      You may want to resize the chart 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.