cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

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.

            
              <script src="//variancecharts.com/cdn/variance-noncommercial-standalone-f47ffcf.min.js" charset="UTF-8"></script>

<link id="enrollment_rate" rel="variance-data" href="//variancecharts.com/data/enrollment_rate.json">

<div id="education_participation">

  <h3>Global Participation in Primary Education</h3>
  <h4>by net enrollment rate, 2000 &amp; 2009</h4>

  <chart data="#enrollment_rate"
         map-xy="year netEnrollment"
         scale-x-linear="2000 2009" scale-y-linear="70 100">
    <annotation class="year-left">2000</annotation>
    <annotation class="year-right">2009</annotation>
    <guide-y>
      <span class="label left">{{value}}%</span>
      <span class="label right">{{value}}%</span>
    </guide-y>
    <groups by="country">
      <line class="{{country}}"></line>
      <repeat>
        <point class="{{country}}"></point>
        <annotation class="{{country}}">
          <span class="country">{{country}}</span>
          <span class="enrollment">{{netEnrollment}}</span>
        </annotation>
      </repeat>
    </groups>
  </chart>

</div>
            
          
!
            
              #education_participation {
  width: 80%;
  padding: 50px 80px 60px 80px;
  color: #444444;
  font-family: Helvetica, Arial, sans-serif;
  background: white;
}
#education_participation h3 {
  margin: 0 0 4px 0;
  text-align: center;
}
#education_participation h4 {
  margin: 0 0 28px 0;
  font-weight: normal;
  font-style: italic;
  text-align: center;
  color: #666666;
}
#education_participation chart {
  width: 30%;
  height: 500px;
  margin-top: 48px;
}
#education_participation guide-y {
  width: 180%;
  margin-left: -90%;
  left: 50%;
  border: none;
}
#education_participation guide-y .tick {
  width: 100%;
  border-color: #e2e2e2;
}
#education_participation guide-y .tick .label {
  text-align: left;
  right: auto;
  color: #cccccc;
  font-size: 24px;
  top: -14px;
  width: 100px;
}
#education_participation guide-y .tick .label.left {
  margin-left: -108px;
  text-align: right;
}
#education_participation guide-y .tick .label.right {
  right: 0;
  margin-right: -108px;
  text-align: left;
}
#education_participation guide-y .tick:nth-child(even) .label {
  display: none;
}
#education_participation line.World path {
  stroke: orange;
  stroke-width: 2px;
}
#education_participation point {
  background-color: #444444;
}
#education_participation point.World {
  background-color: orange;
}
#education_participation annotation {
  font-size: 12px;
  width: 300px;
  margin-bottom: 7px;
}
#education_participation annotation.year-right {
  right: 0;
  margin-right: -96px;
}
#education_participation annotation.year-left {
  text-align: right;
  margin-left: -96px;
}
#education_participation annotation.year-right, #education_participation annotation.year-left {
  width: auto;
  font-size: 24px;
  top: 6px;
  z-index: 100;
  font-weight: bold;
  width: 100px;
}
#education_participation annotation.World {
  color: orange;
  text-transform: uppercase;
  font-weight: bold;
}
#education_participation annotation.World .country {
  color: orange;
}
#education_participation annotation .enrollment {
  font-weight: bold;
}
#education_participation annotation .country {
  color: #666666;
}
#education_participation datum:first-child annotation {
  margin-left: -308px;
  text-align: right;
}
#education_participation datum:first-child .enrollment {
  float: right;
  margin-left: 4px;
}
#education_participation datum:last-child annotation {
  margin-left: 8px;
}
#education_participation datum:last-child .enrollment {
  float: left;
  margin-right: 4px;
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console