NCIOCPL / cgov-digital-platform

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

Update FY 2021 Cancer Moonshot and Carryover Obligations chart to load data from JSON file #3728

Closed sarinapadilla closed 1 year ago

sarinapadilla commented 1 year ago

The FY 2021 Cancer Moonshot and Carryover - Obligations by Mechanism 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/moonshot-obligations.js

Parent Issue: #3008

Notes

Data:

{
    chart: { type: 'NCI_pie' },
    title: { text: 'FY 2021 Cancer Moonshot and Carryover - Obligations by Mechanism' },
    subtitle: { text: 'Fiscal Year 2021' },
    series: [{
      name: 'Budget',
      data: [{ name: 'Research Grants', y: 122936908, drilldown: 'Research Grants' }, { name: 'Intramural Research', y: 49648875 }, { name: 'R&D Contracts', y: 33650007, drilldown: 'R&D Contracts' }, { name: 'Research Management & Support', y: 0 }]
    }],

    drilldown: {
      series:

        [{
          name: 'Research Project Grants', id: 'Research Grants',

          colors: ['#2DC799', '#ABE9D6', '#229573', '#17644D', '#D5F4EB', '#0B3226'],

          data: [['RPGs', 67839884], ['Centers', 26374615], ['Other Research', 28722409]]
        },

        {
          name: 'R&D Contract', id: 'R&D Contracts',

          colors: ['#FF5F00', '#FFBF99'],

          data: [['R&D Contracts', 27393003], ['SBIR/STTR Contracts', 6257004]]
        },
        ]
    }
}
sarinapadilla commented 1 year ago

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