Hi all,
Does anyone know how or have examples of creating a line chart with the time on the x-axis and the date on the y-axis? Looking to see the number of requests that come into the queue for an application based on time of day and date.
Thank you.
Discussion posts and replies are publicly visible
a!localVariables( /* ~~~ Open vs. Closed Cases ~~~ / / Query for the count of Closed cases, aggregating by the date they were closed on. */ local!resolvedByDate: a!dataSubset( data: { {created_on: datetime(2019, 1, 10, 5, 7, 10, 0), id_count: 65, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 11, 5, 7, 10, 0), id_count: 66, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 12, 5, 7, 10, 0), id_count: 67, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 13, 5, 7, 10, 0), id_count: 70, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 14, 6, 7, 10, 0), id_count: 72, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 15, 6, 7, 10, 0), id_count: 69, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 16, 6, 7, 10, 0), id_count: 75, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 17, 6, 7, 10, 0), id_count: 73, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 18, 6, 7, 10, 0), id_count: 77, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 19, 6, 7, 10, 0), id_count: 80, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 20, 6, 7, 10, 0), id_count: 76, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 21, 6, 7, 10, 0), id_count: 78, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 22, 6, 7, 10, 0), id_count: 80, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 23, 6, 7, 10, 0), id_count: 77, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 24, 6, 7, 10, 0), id_count: 75, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 25, 6, 7, 10, 0), id_count: 80, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 26, 6, 7, 10, 0), id_count: 83, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 27, 6, 7, 10, 0), id_count: 86, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 28, 6, 7, 10, 0), id_count: 83, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 29, 6, 7, 10, 0), id_count: 88, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 30, 6, 7, 10, 0), id_count: 90, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 1, 31, 6, 7, 10, 0), id_count: 94, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 1, 1, 7, 10, 0), id_count: 135, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 2, 1, 7, 10, 0), id_count: 132, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 3, 1, 7, 10, 0), id_count: 136, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 4, 1, 7, 10, 0), id_count: 138, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 5, 1, 7, 10, 0), id_count: 134, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 6, 1, 7, 10, 0), id_count: 137, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 7, 1, 7, 10, 0), id_count: 135, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 8, 1, 7, 10, 0), id_count: 137, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 9, 1, 7, 10, 0), id_count: 135, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 10, 0, 0, 0, 0), id_count: 138, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 11, 0, 0, 0, 0), id_count: 137, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 12, 0, 0, 0, 0), id_count: 139, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 13, 0, 0, 0, 0), id_count: 140, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 14, 0, 0, 0, 0), id_count: 136, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 15, 0, 0, 0, 0), id_count: 142, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 16, 0, 0, 0, 0), id_count: 146, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 17, 0, 0, 0, 0), id_count: 144, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 18, 0, 0, 0, 0), id_count: 146, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 19, 0, 0, 0, 0), id_count: 150, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 20, 0, 0, 0, 0), id_count: 146, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 21, 0, 0, 0, 0), id_count: 146, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 22, 0, 0, 0, 0), id_count: 148, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 23, 0, 0, 0, 0), id_count: 145, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 24, 0, 0, 0, 0), id_count: 147, time: time(5, 7, 10, 0)}, {created_on: datetime(2019, 3, 25, 0, 0, 0, 0), id_count: 145, time: time(5, 7, 10, 0)} } ), { a!lineChartField( label: "Closed Cases", yAxisTitle: "# of Cases", categories: index(local!resolvedByDate.data, "created_on"), series: { a!chartSeries( label: "Closed", data: index(local!resolvedByDate.data, "id_count"), color: "GREEN" ) } ) })
Example code we are using. We want to change the "number of cases" to "time of day".
This would be three dimensions. Appian does only support two dimensions OOTB. You could just use the x-axis for time (e.g. grouped by hour) and the number of request for the y-axis. Appian is pretty good in handling large amounts of data and allows to zoom in.
Another idea would be to use the Google charts plugin with more options.
Thank you for the information Stefan!