NCIOCPL / cgov-digital-platform

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

Update Percent Share of Total RPG Funds, FY 21 chart to load data from JSON file #3734

Closed sarinapadilla closed 1 year ago

sarinapadilla commented 1 year ago

The Percent Share of Total RPG Funds, FY 21 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/rpg-funding.js

Parent Issue: #3008

Notes

Data:

{
    chart: {
      type: 'NCI_pie'
    },
    plotOptions: {
      pie: {
        size: '75%'
      }
    },
    colors: ['#80378B', '#602968', '#B387B9', '#532C68', '#D0B9D7', '#5A4F79', '#DCD5E1', '#995FA2'],
    title: { text: 'Percent Share of Total RPG Funds, FY 21' },
    series: [{
      name: 'Funding',
      data: [
        ['R01/R37', 1723346.39],
        ['P01 Program Projects', 196613.35],
        ['R03 Small Grants', 8382.87],
        ['R21 Exploratory Phase I', 89334.25],
        ['R33 Exploratory Phase II', 16534.97],
        ['R35', 158472.18],
        ['SBIR/STTR', 158269.50],
        ['Other', 374797.05]
      ]
    }],
    responsive: {
      rules: [{
        condition: {
          maxWidth: 596
        },
        chartOptions: {
          chart: { height: 600 },
          legend: {
            layout: 'horizontal',
            itemWidth: 150
          }
        }
      }, {
        condition: {
          minWidth: 597
        },
        chartOptions: {
          chart: { height: 450 }
        }
      }]
    },
}
sarinapadilla commented 1 year ago

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