Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


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


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.


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.

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.


                 <div id="app">
      :graph-items="[{name: 'Design Projects', amount: [5,2,7,11,15,2,7,3,9,4,2,8]},
                     {name: 'Web pages', amount: [4,2,5,2,2,7,3,9,4,2,5,2]},
                     {name: '3d animations', amount: [2,5,2,7,11,4,2,5,15,8,7,3]}]"></year-graph>


  margin 0
  padding 0

  outline: none

  display flex
  justify-content center
  align-items center
  height 100vh
  font-family sans-serif
  color rgb(255, 255, 255)
  background rgb(15, 15, 15)

    width 360px
    height 200px
    transform rotateX(180deg)
    border-bottom 1px solid  rgba(244, 65, 190, .2)
    background linear-gradient(rgba(244, 65, 190, .2) 1px , transparent 0) repeat-y top / 100% 40px 
      margin-top 20px
      position relative
    display flex
    justify-content center
    margin 20px 10px
    width 85px
    padding 0 10px
    height @width
    border-radius 50%
    border none
    background transparent 
    color rgb(255, 255, 255)
    position relative
    background rgb(15, 15, 15)
    transition .4s ease
    box-shadow 0px 5px 5px rgb(65, 244, 106)
      content ''
      position absolute
      transition .4s ease
      top 0
      right 0
      bottom 0
      left 0
      border-radius 50%
      transform scale(1.1)
      background linear-gradient(rgb(244, 66, 104), rgb(65, 139, 244))
      opacity .4
      z-index -1
      box-shadow 0px -4px 5px rgb(65, 244, 106)
        transform scale(1.1) rotate(180deg)
    position absolute
    left: -75px
      top -20px
      height 220px
      display flex 
      flex-direction column 
      justify-content space-between
      display flex
      justify-content space-between
      bottom -40px
      width 425px
      padding 5px 15px 5px 0px
      display flex
      flex-direction column-reverse
      margin-top 0px
      display flex
      justify-content center 
      align-items center
      height 40px
      display inline-block
      width 20px
      padding-left 9.5px


                Vue.component('year-graph', {
  <secction class="graph"> 
  <div class="graph__navigation">
  <button class="graph__button graph__button--navigation"
  v-for="(item, index) of graphItems"
  :class="{'graph__button--active' : currentName ==}"
  <div class="graph__canvas-wrapper">
  <canvas id="graph-canvas" class="graph__canvas" width="360" height="200"></canvas>
  <div class="graph__info graph__info--amount">
    <p class="graph__text">Amount</p>
    <p class="graph__text graph__text--amount">
      <span class="graph__text--number"
       v-for="item of 5">{{item * 5}}</span>
  <div class="graph__info graph__info--months">
  <p class="graph__text">Month</p>
  <p class="graph__text graph__text--months">
     class="graph__text graph__text--month"
     v-for="item of 12">{{item}}</span>

  props: {
    graphItems: {
      type: Array,
      require: true
  data() {
    return {
      currentName: '',
      currentAmount: '',
      context: '',
      currentY: []
  methods: {
    lineDraw(startX, startY,  finishY, ctx) {
      let y = startY || 0;
      function draw(startX,  finishY) {
        let requestAnimation;
        let ctxGradiend = ctx.createLinearGradient(0, 0, 0, 100);
        ctxGradiend.addColorStop(0, "#f44268");
        ctxGradiend.addColorStop(.25, "#ac41f4");
        ctxGradiend.addColorStop(.5, "#418bf4");
        ctxGradiend.addColorStop(1, "#41f46a");

        ctx.fillStyle = ctxGradiend;

        ctx.fillRect(startX, 0, 20, y);
        requestAnimation = requestAnimationFrame(()=> {       
          // ctx.fillStyle = `hsl(${y},90%,30%)`;
          y < finishY ?  y+=2 : y > finishY ? y-=2 : cancelAnimationFrame(requestAnimation);
          draw(startX,  finishY)
      draw(startX,  finishY);

    changeInformation(data) {
      this.currentName =,
      this.currentAmount  = data.amount
      let counter = 0;
      for(let i = 0; i < this.currentAmount.length; i++) {
        this.lineDraw(counter, this.currentY[i], this.currentAmount[i] * 10, this.context);
        counter += 30;
      this.currentY = [];
      for(let i = 0; i < this.currentAmount.length; i++) {
         this.currentY.push(this.currentAmount[i] * 10);
  mounted() {
    const graphCanvas = document.querySelector('#graph-canvas'),
    ctx = graphCanvas.getContext('2d');
    this.context = ctx;

new Vue({
  el: '#app'