Creating a Timeline Chart

Complete the following steps to create a timeline chart with two series:

  1. Place a chart control on a page in Application Designer.

  2. Create an instance of the Timeline class in PeopleCode.

    &oTChart = GetTimeline(QE_CDEMO_WRK.QE_CHART_TIMELINE);
  3. Specify labels for the series.

    &oTChart.SetSeriesLabels(CreateArray("TimeLine Series 1", "TimeLine Series 2"));
  4. Set the scale of the major axis.

    &oTChart.MajorAxisScale = "quarters";
  5. Set the scale of the minor axis.

    &oTChart.MinorAxisScale = "months";
  6. Set zoom order of the timeline.

    &oTChart.MinorAxisZoomOrder = CreateArray("months", "weeks");
  7. Specify start time of the timeline.

    &oTChart.Start = DateTimeValue("2012-11-01 00:30:40.12-0600");
  8. Specify end time of the timeline.

    &oTChart.End = DateTimeValue("2013-12-30 00:30:40.12-0600");
  9. Set the record for chart data.

    &oTChart.SetData(Record.QE_TLINE_DATA);
  10. Specify the field representing the identifier for the time line series.

    &oTChart.SetDataSeries(QE_TLINE_DATA.QE_TIMELINE_SERIES);
  11. Specify the field for the start time of the timeline item.

    &oTChart.SetDataItemStart(QE_TLINE_DATA.QE_TIMELINE_START);
  12. Specify the field for the description to display on the timeline item.

    &oTChart.SetDataItemDescription(QE_TLINE_DATA.QE_DESCR50);
  13. Specify the field for the title to display on the timeline item.

    &oTChart.SetDataItemTitle(QE_TLINE_DATA.QE_CHARTTITLE);
  14. Specify the timeline orientation.

    &oTChart.Orientation = %Chart_Vertical;

The preceding lines of PeopleCode generate the following timeline chart assuming that sample data is provided for the chart.

A resulting timeline chart.

Timeline Chart with 2 series