Skip to content

Add 2030 Goal Line

Linda Mejia edited this page Jun 30, 2020 · 4 revisions
  1. First add the Year: 2030 and the desired goal Value to the indicator data file. An example can be found here.

  2. Add the following to scripts.html file inside the _includes folder:

<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-annotation/0.5.7/chartjs-plugin-annotation.js"></script>

  1. In assets/js/indicatorView.js in the _includes folder as well add these functions. The first function adds the line and calls the remove2030 function to remove the value for the year 2030 from the dataset captured by the chart: Get Goal Function

  2. Lastly, add the code below to the this.createPlot function (you can find an example here):

annotation