Query regarding Column Chart

Hi

I am working on version 19.1.

I have a query regarding column chart. I have created a column chart. The code for this is:

load(
  local!pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: -1,
    sort: a!sortInfo(
      field: "month",
      ascending: true
    )
  ),
  local!monthSelected,
  local!monthDetails:index(
    a!queryEntity(
      entity: cons!MONTH_DETAILS,
      query: a!query(
        aggregation: a!queryAggregation(aggregationColumns: {
          a!queryAggregationColumn(field: "month", isGrouping: true),
          a!queryAggregationColumn(field: "id", alias: "count", aggregationFunction: "COUNT"),
        }),
        pagingInfo: local!pagingInfo
      )
    ),
    "data",
    {}
   ),
  a!columnChartField(
    categories: index(local!monthDetails, "month", null),
    series: {
      a!chartSeries(
        label: "Months",
        color:"AMBER",
        data: index(local!monthDetails, "id", null),
        links:a!forEach(
          items: local!monthDetails,
          expression: a!dynamicLink(
            value:index(fv!item, "month", null),
            saveInto:{
              local!monthSelected
            }
          )
        )
     )
    },
    xAxisTitle:"Months",
    yAxisTitle:"Population",
    showLegend: false,
    showTooltips: true,
    showDataLabels:true
  )
)

The chart created is:

If you go through the chart created, except 3 months the column for each created for each month is in the range of thousands. For the months Jan, Jun and Sep; the column is not displayed on the chart (I guess because of the range on Y Axis is 10,000 and Appian doesn't display the column for these months) My requirement is, the columns are clickable links. So for these three months i.e. Jan, Jun and Sep; I would like to know how can user click the columns as columns actually don't exist for these three months despite data values being there.

Thanks in advance!!

  Discussion posts and replies are publicly visible

  • This is a known issue with data that has a large variance and (as far as I know) there is no easy answer. One option is to catch in your expression that derives the data for the columns where values are less than, say, 1000 and artificially set them to 1000 so as to force the column to appear:

    a!chartSeries(
            label: "Months",
            color:"AMBER",
            /*data: index(local!monthDetails, "id", null),*/
            data: a!forEach(
              items: fn!index(local!monthDetails,"id"),
              expression: if(fv!item<1000,1000,fv!item),
            ),
            links:a!forEach(
              items: local!monthDetails,
              expression: a!dynamicLink(
                value:index(fv!item, "month", null),
                saveInto:{
                  ri!monthSelected
                }
              )
            )
          )

    which results in something like this:

    ...and then have some sort of annotation on the page to indicate that the actual values are LESS THAN 1000. Clicking on the column will then allow the user to see what the actual value is. It's not great but it works. 

    I've seen some chat about how to handle such wide-ranging values in charts in general (i.e. nothing to do with Appian) and there are a couple of options:

    • have logarithmic scales (not intuitive to the average person but would be useful for mathematically-oriented applications)
    • discontinuous axis - so, in your case, having a y-axis that shows 0-100, and then a non-linear break in the axis that picks up again at 10k. This would get my vote.

  • Don't know what I was thinking of...you can, of course, swap out the column chart for a line chart:

    Each node is then clickable.

    (personally I think a line chart indicates the trends between the categories rather than each category being a distinct set of data which is why i'm guessing you were shooting for a column chart. But, hey, this works better than my previous solution!)

  • 0
    Certified Lead Developer
    in reply to Stewart Burchell

    The Appian-side solution that springs to mind for me would be for them to adjust the column chart component to detect when a column is rendered at a height of zero pixels despite a nonzero value, and render it as a column 1 or 2 pixels high anyway (or, at least, have a clickable number tag).