Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <script src="https://cdn.anychart.com/releases/8.11.0/js/anychart-core.min.js"></script>
<script src="https://cdn.anychart.com/releases/8.11.0/js/anychart-polar.min.js"></script>

<script src="https://cdn.anychart.com/releases/8.11.0/js/anychart-data-adapter.min.js"></script>

<div id="container"></div>
              
            
!

CSS

              
                html,
body,
#container {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}
              
            
!

JS

              
                anychart.onDocumentReady(function () {
  anychart.data.loadJsonFile(
    "https://gist.githubusercontent.com/shacheeswadia/3cc96d8ed792bfa0c04fbd3825816fde/raw/606c2646df568f30bd39dc01fcd4efe6e92b3bac/vaccineData.json",
    function (data) {
      // create a polar chart instance
      var chart = anychart.polar();
      // set the inner radius to create a hole in the center
      chart.innerRadius(80);

      // y scale shows phases
      // set it as ordinal
      chart.yScale("ordinal");
      // define the order of values on the scale
      chart
        .yScale()
        .values([
          "Phase 4",
          "Phase 3",
          "Phase 2/3",
          "Phase 1/2",
          "Phase 2",
          "Phase 1",
          "NA"
        ]);

      // x scale shows vaccine types
      // set it as ordinal
      chart.xScale("ordinal");
      // define the order of values on the scale
      chart
        .xScale()
        .values([
          "Bacterial antigen-spore expression vector",
          "DNA based vaccine",
          "Inactivated virus",
          "Live attenuated virus",
          "Protein subunit",
          "RNA based vaccine",
          "Viral vector (Non-replicating)",
          "Viral vector (Non-replicating) + APC",
          "Viral vector (Replicating)",
          "Viral vector (Replicating) + APC",
          "Virus like particle"
        ]);

      // add a series with given properties
      function createSeries(seriesId) {
        // create a series
        const series = chart.marker();
        // the name for display is beautified
        const seriesName =
          seriesId +
          (seriesId == "NR" ? "" : seriesId == 1 ? " dose" : " doses");
        // set size, name, id 
        series.size(2).name(seriesName).id(seriesId);
        return series;
      }

      // add a marker series with the given data
      function addPoint(item) {
        // number of doses is a series id
        const seriesId = item["Number of doses"];
        // check if there is a series like we need
        var series = chart.getSeries(seriesId);
        // if there is no such series we create and configure it
        if (series == null) {
          series = createSeries(seriesId);
        }
        // add the data into the series
        series
          .data()
          .getDataSets()[0]
          .append({
            x: item["Vaccine platform description"],
            y: item["Phase"],
            ...item
          });
      }

      // loop through the dataset
      // point by point
      data.forEach((vaccine) => addPoint(vaccine));

      // spread bullets throughout a sector
      chart.spreadValues("valueEqual");

      // title of the chart
      chart.title("COVID-19 Vaccine Pipeline");

      // set the chart container id
      chart.container("container");

      // draw the resulting bullseye chart
      chart.draw();
    }
  );
});

              
            
!
999px

Console