NCIOCPL / cgov-digital-platform

The Cancer.gov Digital Communications Platform
GNU General Public License v2.0
11 stars 33 forks source link

Update RPGs Number of Awards chart to load data from JSON file #3729

Closed sarinapadilla closed 1 year ago

sarinapadilla commented 1 year ago

The RPGs Number of Awards highchart currently hardcodes the data for the chart within the .js file. The javascript should load the data from a JSON file uploaded in the CMS.

Chart .js: https://github.com/NCIOCPL/cgov-digital-platform/blob/develop/docroot/profiles/custom/cgov_site/themes/custom/cgov/cgov_common/src/libraries/charts/library/number-rpg-awards.js

Parent Issue: #3008

Notes

Data:

{
    chart: {
      type: 'NCI_column'
    },
    title: { text: 'RPGs Number of Awards' },
    subtitle: { text: 'Fiscal Years 2011 - 2021' },
    plotOptions: {
      series: {
        pointStart: 2011
      }
    },
    xAxis: [{
      type: 'category',
      showEmpty: false,
      title: { text: 'Fiscal Year' }
    }],
    yAxis: {
      title: { text: 'Number of RPGs' },
      max: 4000
    },
    series: [{
      name: 'Competing',
      data: [1106, 1220, 1095, 1378, 1371, 1365, 1311, 1356, 1336, 1350, 1486]
    }, {
      name: 'Non-Competing',
      data: [3913, 3801, 3721, 3436, 3396, 3301, 3352, 3424, 3648, 3720, 3724]
    }]
}
sarinapadilla commented 1 year ago

This task was completed with PR #3778, so closing this ticket!