Aggregation field COUNT Provided data cannot connect into a line in in a line chart

Created on 5 September 2024, 7 months ago

My view configuration:

My view output:

Normal integer field works as expected as below:

I tried C3/chart.js/highcharts libraries, all failed.

πŸ’¬ Support request
Status

Active

Version

5.1

Component

Views integration

Created by

πŸ‡¨πŸ‡³China fishfree

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @fishfree
  • πŸ‡ΊπŸ‡ΈUnited States andileco

    Thanks for this and your documentation request (will try to get to it soon). The issue is that the way we designed the Grouping is to make each item with a different name its own series, hence the line not connecting. Do you need to group for that view? Could you use Stacking instead?

  • πŸ‡¨πŸ‡³China fishfree

    @andileco I need to use the aggregation COUNT functionality in Views module, because thus way, users needn't manually input the count / sum / average data.

  • πŸ‡ΊπŸ‡ΈUnited States andileco

    Sorry, I was referring to the "Grouping field" in the Chart configuration. You are grouping by year. That shouldn't be necessary as far as I can tell.

  • πŸ‡¨πŸ‡³China fishfree

    @andileco Thank you! But I have to group by a date field for viewing the trend line year by year. If I use stacking instead of grouping, the oupout will be as below:

    I don't know where come from the right part of the chart, esp. those labels. The oupput debug JSON is as below:

    {
     "chart": {
      "type": "line",
      "backgroundColor": "",
      "polar": 0,
      "options3d": {
       "enabled": 0
      },
      "renderTo": "chart-book-charts-page-1--OeovnNMsmqs"
     },
     "credits": {
      "enabled": false
     },
     "title": {
      "text": "",
      "style": {
       "color": "#000"
      },
      "verticalAlign": "top"
     },
     "subtitle": {
      "text": "",
      "verticalAlign": "top"
     },
     "colors": [
      "#006fb0",
      "#f07c33",
      "#342e9c",
      "#579b17",
      "#3f067a",
      "#cbde67",
      "#7643b6",
      "#738d00",
      "#c157c7",
      "#02dab1",
      "#ed56b4",
      "#d8d981",
      "#004695",
      "#736000",
      "#a5a5ff",
      "#833a00",
      "#ff9ee9",
      "#684507",
      "#fe4f85",
      "#5d0011",
      "#ffa67b",
      "#88005c",
      "#ff9b8f",
      "#85000f",
      "#ff7581"
     ],
     "tooltip": {
      "enabled": true,
      "useHTML": false
     },
     "plotOptions": {
      "series": {
       "stacking": "1",
       "dataLabels": {
        "enabled": true
       },
       "marker": {
        "enabled": true
       }
      }
     },
     "legend": {
      "enabled": false
     },
     "xAxis": [
      {
       "type": "",
       "title": {
        "text": "",
        "style": {
         "color": "#000"
        }
       },
       "categories": [
        "1921",
        "1923",
        "1925",
        "1928",
        "1929",
        "1930",
        "1932",
        "1933",
        "1934",
        "1935",
        "1936",
        "1937",
        "1940",
        "1943",
        "1944",
        "1945",
        "1946",
        "1947",
        "1948",
        "1949",
        "1950",
        "1951",
        "1952",
        "1953",
        "1954",
        "1955",
        "1956",
        "1957",
        "1958",
        "1959",
        "1960",
        "1962",
        "1963",
        "1976",
        "1978",
        "1979",
        "1980",
        "1981",
        "1982",
        "1983",
        "1984",
        "1985",
        "1986",
        "1987",
        "1988",
        "1989",
        "1990",
        "1991",
        "2009"
       ],
       "labels": {
        "style": {
         "color": "#000"
        },
        "rotation": 60,
        "align": "left"
       },
       "gridLineColor": "#ccc",
       "lineColor": "#ccc",
       "minorGridLineColor": "#e0e0e0",
       "opposite": false
      }
     ],
     "yAxis": [
      {
       "type": "",
       "title": {
        "text": "",
        "style": {
         "color": "#000"
        }
       },
       "labels": {
        "style": {
         "color": "#000"
        },
        "rotation": 0
       },
       "gridLineColor": "#ccc",
       "lineColor": "#ccc",
       "minorGridLineColor": "#e0e0e0",
       "opposite": false
      }
     ],
     "series": [
      {
       "name": "",
       "color": "#14f02e",
       "data": [
        1,
        2,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        2,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        2,
        2,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        2,
        1,
        2,
        5,
        1,
        1,
        1,
        2,
        3,
        1,
        1,
        1,
        3,
        1,
        1,
        1,
        4,
        1,
        2,
        1,
        1,
        1,
        1,
        5,
        1,
        2,
        1,
        1,
        1,
        1,
        2,
        2,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1
       ]
      }
     ],
     "drupalChartDivElement": {
      "hcEvents": {
       "mousedown": [
        {
         "order": null
        }
       ],
       "touchstart": [
        {
         "order": null
        }
       ]
      }
     },
     "drupalChartDivId": "chart-book-charts-page-1--OeovnNMsmqs"
    }
  • πŸ‡ΊπŸ‡ΈUnited States andileco

    I think aggregation should handle that for you. Try creating the data for your chart as a Table display, then switch to the Chart display.

  • Status changed to Postponed: needs info 10 days ago
  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    Hi fishfree,

    Were you able to get the chart working?

  • πŸ‡¨πŸ‡³China fishfree

    @bluegeek9 No, no luck.

Production build 0.71.5 2024