Select Page

Building a Donut Chart with Vue and SVG

Building a Donut Chart with Vue and SVG

Mmm… forbidden donut.”

– Homer Simpson

I recently needed to make a donut chart for a reporting dashboard at work. The mock-up that I got looked something like this:

My chart had a few basic requirements. It needed to:

  • Dynamically calculate its segments based on an arbitrary set of values
  • Have labels
  • Scale well across all screen sizes and devices
  • Be cross-browser compatible back to Internet Explorer 11
  • Be accessible
  • Be reusable across my work’s Vue.js front end

I also wanted something that I could animate later if I needed to. All of this sounded like a job for SVG.

SVGs are accessible out-of-the-box (the W3C has a whole section on this) and can be made more accessible through additional input. And, because they’re powered by data, they’re a perfect candidate for dynamic visualization.

There are plenty of articles on the topic, including two by Chris (here and here) and a super recent one by Burke Holland. I didn’t use D3 for this project because the application didn’t need the overhead of that library.

I created the chart as a Vue component for my project, but you could just as easily do this with vanilla JavaScript, HTML, and CSS.

Here’s the finished product:

See the Pen Vue Donut Chart – Final Version by Salomone Baquis (@soluhmin) on CodePen.

Reinventing the wheel circle

Like any self-respecting developer, the first thing I did was Google to see if someone else had already made this. Then, like same said developer, I scrapped the pre-built solution in favor of my own.

The top hit for “SVG donut chart” is this article, which describes how to use stroke-dasharray and stroke-dashoffset to draw multiple overlaid circles and create the illusion of a single segmented circle (more on this shortly).

I really like the overlay concept, but found recalculating both stroke-dasharray and stroke-dashoffset values confusing. Why not set one fixed stroke-dasharrary value and then rotate each circle with a transform? I also needed to add labels to each segment, which wasn’t covered in the tutorial.

Drawing a line

Before we can create a dynamic donut chart, we first need to understand how SVG line drawing works. If you haven’t read Jake Archibald’s excellent Animated Line Drawing in SVG. Chris also has a good overview.

Those articles provide most of the context you’ll need, but briefly, SVG has two presentation attributes: stroke-dasharray and stroke-dashoffset.

stroke-dasharray defines an array of dashes and gaps used to paint the outline of a shape. It can take zero, one, or two values. The first value defines the dash length; the second defines the gap length.

stroke-dashoffset, on the other hand, defines where the set of dashes and gaps begins. If the stroke-dasharray and the stroke-dashoffset values are the length of the line and equal, the entire line is visible because we’re telling the offset (where the dash-array starts) to begin at the end of the line. If the stroke-dasharray is the length of the line, but the stroke-dashoffset is 0, then the line is invisible because we’re offsetting the rendered part of the dash by its entire length.

Chris’ example demonstrates this nicely:

See the Pen Basic Example of SVG Line Drawing, Backward and Forward by Chris Coyier (@chriscoyier) on CodePen.

How we’ll build the chart

To create the donut chart’s segments, we’ll make a separate circle for each one, overlay the circles on top of one another, then use stroke, stroke-dasharray, and stroke-dashoffset to show only part of the stroke of each circle. We’ll then rotate each visible part into the correct position, creating the illusion of a single shape. As we do this, we’ll also calculate the coordinates for the text labels.

Here’s an example demonstrating these rotations and overlays:

See the Pen Circle Overlays by Salomone Baquis (@soluhmin) on CodePen.

Basic setup

Let’s start by setting up our structure. I’m using x-template for demo purposes, but I’d recommend creating a single file component for production.

Vue.component('donutChart', {
  template: '#donutTemplate',
  props: ["initialValues"],
  data() {
    return {
      chartData: [],
      colors: ["#6495ED", "goldenrod", "#cd5c5c", "thistle", "lightgray"],
      cx: 80,
      cy: 80,                      
      radius: 60,
      sortedValues: [],
      strokeWidth: 30,    
    }
  }  
})
new Vue({
  el: "#app",
  data() {
    return {
      values: [230, 308, 520, 130, 200]
    }
  },
});

With this, we:

  • Create our Vue instance and our donut chart component, then tell our donut component to expect some values (our dataset) as props
  • Establish our basic SVG shapes: for the segments and for the labels, with the basic dimensions, stroke width, and colors defined
  • Wrap these shapes in a element, which groups them together
  • Add a v-for loop to the g> element, which we’ll use to iterate through each value that the component receives
  • Create an empty sortedValues array, which we’ll use to hold a sorted version of our data
  • Create an empty chartData array, which will contain our main positioning data

Circle length

Our stroke-dasharray should be the length of the entire circle, giving us an easy baseline number which we can use to calculate each stroke-dashoffset value. Recall that the length of a circle is its circumference and the formula for circumference is 2πr (you remember this, right?).

We can make this a computed property in our component.

computed: {
  circumference() {
    return 2 * Math.PI * this.radius
  }
}

…and bind the value to our template markup.


  
    
    
  

In the initial mockup, we saw that the segments went from largest to smallest. We can make another computed property to sort these. We’ll store the sorted version inside the sortedValues array.

sortInitialValues() {
  return this.sortedValues = this.initialValues.sort((a,b) => b-a)
}

Finally, in order for these sorted values to be available to Vue before the chart gets rendered, we’ll want to reference this computed property from the mounted() lifecycle hook.

mounted() {
  this.sortInitialValues                
}

Right now, our chart look like this:

See the Pen Donut Chart – No Segments by Salomone Baquis (@soluhmin) on CodePen.

No segments. Just a solid-colored donut. Like HTML, SVG elements are rendered in the order that they appear in the markup. The color that appears is the stroke color of the last circle in the SVG. Because we haven’t added any stroke-dashoffset values yet, each circle’s stroke goes all the way around. Let’s fix this by creating segments.

Creating segments

To get each of the circle segments, we’ll need to:

  1. Calculate the percentage of each data value from the total data values that we pass in
  2. Multiply this percentage by the circumference to get the length of the visible stroke
  3. Subtract this length from the circumference to get the stroke-offset

It sounds more complicated than it is. Let’s start with some helper functions. We first need to total up our data values. We can use a computed property to do this.

dataTotal() {
  return this.sortedValues.reduce((acc, val) => acc + val)
},

To calculate the percentage of each data value, we’ll need to pass in values from the v-for loop that we created earlier, which means that we’ll need to add a method.

methods: {
  dataPercentage(dataVal) {
    return dataVal / this.dataTotal
  }
},

We now have enough information to calculate our stroke-offset values, which will establish our circle segments.

Again, we want to: (a) multiply our data percentage by the circle circumference to get the length of the visible stroke, and (b) subtract this length from the circumference to get the stroke-offset.

Here’s the method to get our stroke-offsets:

calculateStrokeDashOffset(dataVal, circumference) {
  const strokeDiff = this.dataPercentage(dataVal) * circumference
  return circumference - strokeDiff
},

…which we bind to our circle in the HTML with:

:stroke-dashoffset="calculateStrokeDashOffset(value, circumference)"

And voilà! We should have something like this:

See the Pen Donut Chart – No Rotations by Salomone Baquis (@soluhmin) on CodePen.

Rotating segments

Now the fun part. All of segments begin at 3 o’clock, which is the default starting point for SVG circles. To get them in the right place, we need to rotate each segment to its correct position.

We can do this by finding each segment’s ratio out of 360 degrees and then offset that amount by the total degrees that came before it.

First, let’s add a data property to keep track of the offset:

angleOffset: -90,

Then our calculation (this is a computed property):

calculateChartData() {
  this.sortedValues.forEach((dataVal, index) => {
    const data = {
      degrees: this.angleOffset,
    }
    this.chartData.push(data)
    this.angleOffset = this.dataPercentage(dataVal) * 360 + this.angleOffset
  })
},

Each loop creates a new object with a “degrees” property, pushes that into our chartValues array that we created earlier, and then updates the angleOffset for the next loop.

But wait, what’s up with the -90 value?

Well, looking back at our original mockup, the first segment is shown at the 12 o’clock position, or -90 degrees from the starting point. By setting our angleOffset at -90, we ensure that our largest donut segment starts from the top.

To rotate these segments in the HTML, we’ll use the transform presentation attribute with the rotate function. Let’s create another computed property so that we can return a nice, formatted string.

returnCircleTransformValue(index) {
  return rotate(${this.chartData[index].degrees}, ${this.cx}, ${this.cy})`
},

The rotate function takes three arguments: an angle of rotation and x and y coordinates around which the angle rotates. If we don’t supply cx and cy coordinates, then our segments will rotate around the entire SVG coordinate system.

Next, we bind this to our circle markup.

:transform="returnCircleTransformValue(index)"

And, since we need to do all of these calculations before the chart is rendered, we’ll add our calculateChartData computed property in the mounted hook:

mounted() {
  this.sortInitialValues
  this.calculateChartData
}

Finally, if we want that sweet, sweet gap between each segment, we can subtract two from the circumference and use this as our new stroke-dasharray.

adjustedCircumference() {
  return this.circumference - 2
},
:stroke-dasharray="adjustedCircumference"

Segments, baby!

See the Pen Donut Chart – Segments Only by Salomone Baquis (@soluhmin) on CodePen.

Labels

We have our segments, but now we need to create labels. This means that we need to place our elements with x and y coordinates at different points along the circle. You might suspect that this requires math. Sadly, you are correct.

Fortunately, this isn’t the kind of math where we need to apply Real Concepts; this is more the kind where we Google formulas and don’t ask too many questions.

According to the Internet, the formulas to calculate x and y points along a circle are:

x = r cos(t) + a
y = r sin(t) + b

…where r is the radius, t is the angle, and a and b are the x and y center point offsets.

We already have most of this: we know our radius, we know how to calculate our segment angles, and we know our center offset values (cx and cy).

There’s one catch, though: in those formulas, t is in *radians*. We’re working in degrees, which means that we need to do some conversions. Again, a quick search turns up a formula:

radians = degrees * (π / 180)

…which we can represent in a method:

degreesToRadians(angle) {
  return angle * (Math.PI / 180)
},

We now have enough information to calculate our x and y text coordinates:

calculateTextCoords(dataVal, angleOffset) {
  const angle = (this.dataPercentage(dataVal) * 360) / 2 + angleOffset
  const radians = this.degreesToRadians(angle)

  const textCoords = {
    x: (this.radius * Math.cos(radians) + this.cx),
    y: (this.radius * Math.sin(radians) + this.cy)
  }
  return textCoords
},

First, we calculate the angle of our segment by multiplying the ratio of our data value by 360; however, we actually want half of this because our text labels are in the middle of the segment rather than the end. We need to add the angle offset like we did when we created the segments.

Our calculateTextCoords method can now be used in the calculateChartData computed property:

calculateChartData() {
  this.sortedValues.forEach((dataVal, index) => {
    const { x, y } = this.calculateTextCoords(dataVal, this.angleOffset)        
    const data = {
      degrees: this.angleOffset,
      textX: x,
      textY: y
    }
    this.chartData.push(data)
    this.angleOffset = this.dataPercentage(dataVal) * 360 + this.angleOffset
  })
},

Let’s also add a method to return the label string:

percentageLabel(dataVal) {
  return `${Math.round(this.dataPercentage(dataVal) * 100)}%`
},

And, in the markup:

{{ percentageLabel(value) }}

Now we’ve got labels:

See the Pen Donut Chart – Unformatted Labels by Salomone Baquis (@soluhmin) on CodePen.

Blech, so off-center. We can fix this with the text-anchor presentation attribute. Depending on your font and font-size, you may want to adjust the positioning as well. Check out dx and dy for this.

Revamped text element:

{{ percentageLabel(value) }}

Hmm, it seems that if we have small percentages, the labels go outside of the segments. Let’s add a method to check for this.

segmentBigEnough(dataVal) {
  return Math.round(this.dataPercentage(dataVal) * 100) > 5
}
{{ percentageLabel(value) }}

Now, we’ll only add labels to segments larger than 5%.

And we’re done! We now have a reusable donut chart component that can accept any set of values and create segments. Super cool!

The finished product:

See the Pen Vue Donut Chart – Final Version by Salomone Baquis (@soluhmin) on CodePen.

Next steps

There are lots of ways that we can modify or improve this now that it’s built. For example:

  • Adding elements to enhance accessibility, such as </code> and <code></code> tags, aria-labels, and aria role attributes.</li> <li>Creating <strong>animations</strong> with CSS or libraries like <a href="https://greensock.com/">Greensock</a> to create eye-catching effects when the chart comes into view.</li> <li>Playing with <strong>color schemes</strong>.</li> </ul> <p>I’d love to hear what you think about this implementation and other experiences you’ve had with SVG charts. Share in the comments!</p> <p>The post <a rel="nofollow" href="https://css-tricks.com/building-a-donut-chart-with-vue-and-svg/">Building a Donut Chart with Vue and SVG</a> appeared first on <a rel="nofollow" href="https://css-tricks.com">CSS-Tricks</a>.</p> <p><a href="https://css-tricks.com/building-a-donut-chart-with-vue-and-svg/" rel="nofollow" target="_blank">Source: </a></p> </div> </div> <div class="post-footer"> <div class="social-icons ed-social-share-icons"> <p class="share-title">Share:</p> <a href="http://www.facebook.com/sharer.php?u=http://gracemanaay.tk/2018/11/07/building-a-donut-chart-with-vue-and-svg/&t=Building%20a%20Donut%20Chart%20with%20Vue%20and%20SVG" class="social-share-link" title="Share "Building a Donut Chart with Vue and SVG" via Facebook" data-network-name="facebook" data-share-title="Building a Donut Chart with Vue and SVG" data-share-url="http://gracemanaay.tk/2018/11/07/building-a-donut-chart-with-vue-and-svg/"> <span class="et-extra-icon et-extra-icon-facebook et-extra-icon-background-hover" ></span> </a><a href="http://twitter.com/home?status=Building%20a%20Donut%20Chart%20with%20Vue%20and%20SVG%20http://gracemanaay.tk/2018/11/07/building-a-donut-chart-with-vue-and-svg/" class="social-share-link" title="Share "Building a Donut Chart with Vue and SVG" via Twitter" data-network-name="twitter" data-share-title="Building a Donut Chart with Vue and SVG" data-share-url="http://gracemanaay.tk/2018/11/07/building-a-donut-chart-with-vue-and-svg/"> <span class="et-extra-icon et-extra-icon-twitter et-extra-icon-background-hover" ></span> </a><a href="https://plus.google.com/share?url=http://gracemanaay.tk/2018/11/07/building-a-donut-chart-with-vue-and-svg/&t=Building%20a%20Donut%20Chart%20with%20Vue%20and%20SVG" class="social-share-link" title="Share "Building a Donut Chart with Vue and SVG" via Google +" data-network-name="googleplus" data-share-title="Building a Donut Chart with Vue and SVG" data-share-url="http://gracemanaay.tk/2018/11/07/building-a-donut-chart-with-vue-and-svg/"> <span class="et-extra-icon et-extra-icon-googleplus et-extra-icon-background-hover" ></span> </a><a href="https://www.tumblr.com/share?v=3&u=http://gracemanaay.tk/2018/11/07/building-a-donut-chart-with-vue-and-svg/&t=Building%20a%20Donut%20Chart%20with%20Vue%20and%20SVG" class="social-share-link" title="Share "Building a Donut Chart with Vue and SVG" via Tumblr" data-network-name="tumblr" data-share-title="Building a Donut Chart with Vue and SVG" data-share-url="http://gracemanaay.tk/2018/11/07/building-a-donut-chart-with-vue-and-svg/"> <span class="et-extra-icon et-extra-icon-tumblr et-extra-icon-background-hover" ></span> </a><a href="http://www.pinterest.com/pin/create/button/?url=http://gracemanaay.tk/2018/11/07/building-a-donut-chart-with-vue-and-svg/&description=Building%20a%20Donut%20Chart%20with%20Vue%20and%20SVG&media=https://css-tricks.com/wp-content/uploads/2018/11/donut-chart-1b.jpg" class="social-share-link" title="Share "Building a Donut Chart with Vue and SVG" via Pinterest" data-network-name="pinterest" data-share-title="Building a Donut Chart with Vue and SVG" data-share-url="http://gracemanaay.tk/2018/11/07/building-a-donut-chart-with-vue-and-svg/"> <span class="et-extra-icon et-extra-icon-pinterest et-extra-icon-background-hover" ></span> </a><a href="http://www.linkedin.com/shareArticle?mini=true&url=http://gracemanaay.tk/2018/11/07/building-a-donut-chart-with-vue-and-svg/&title=Building%20a%20Donut%20Chart%20with%20Vue%20and%20SVG" class="social-share-link" title="Share "Building a Donut Chart with Vue and SVG" via LinkedIn" data-network-name="linkedin" data-share-title="Building a Donut Chart with Vue and SVG" data-share-url="http://gracemanaay.tk/2018/11/07/building-a-donut-chart-with-vue-and-svg/"> <span class="et-extra-icon et-extra-icon-linkedin et-extra-icon-background-hover" ></span> </a><a href="https://bufferapp.com/add?url=http://gracemanaay.tk/2018/11/07/building-a-donut-chart-with-vue-and-svg/&title=Building%20a%20Donut%20Chart%20with%20Vue%20and%20SVG" class="social-share-link" title="Share "Building a Donut Chart with Vue and SVG" via Buffer" data-network-name="buffer" data-share-title="Building a Donut Chart with Vue and SVG" data-share-url="http://gracemanaay.tk/2018/11/07/building-a-donut-chart-with-vue-and-svg/"> <span class="et-extra-icon et-extra-icon-buffer et-extra-icon-background-hover" ></span> </a><a href="http://www.stumbleupon.com/badge?url=http://gracemanaay.tk/2018/11/07/building-a-donut-chart-with-vue-and-svg/&title=Building%20a%20Donut%20Chart%20with%20Vue%20and%20SVG" class="social-share-link" title="Share "Building a Donut Chart with Vue and SVG" via Stumbleupon" data-network-name="stumbleupon" data-share-title="Building a Donut Chart with Vue and SVG" data-share-url="http://gracemanaay.tk/2018/11/07/building-a-donut-chart-with-vue-and-svg/"> <span class="et-extra-icon et-extra-icon-stumbleupon et-extra-icon-background-hover" ></span> </a><a href="#" class="social-share-link" title="Share "Building a Donut Chart with Vue and SVG" via Email" data-network-name="basic_email" data-share-title="Building a Donut Chart with Vue and SVG" data-share-url="http://gracemanaay.tk/2018/11/07/building-a-donut-chart-with-vue-and-svg/"> <span class="et-extra-icon et-extra-icon-basic_email et-extra-icon-background-hover" ></span> </a><a href="#" class="social-share-link" title="Share "Building a Donut Chart with Vue and SVG" via Print" data-network-name="basic_print" data-share-title="Building a Donut Chart with Vue and SVG" data-share-url="http://gracemanaay.tk/2018/11/07/building-a-donut-chart-with-vue-and-svg/"> <span class="et-extra-icon et-extra-icon-basic_print et-extra-icon-background-hover" ></span> </a> </div> <div class="rating-stars"> <p id="rate-title" class="rate-title">Rate:</p><div id="rating-stars"></div><input type="hidden" id="post_id" value="2318" /> </div> <style type="text/css" id="rating-stars"> .post-footer .rating-stars #rated-stars img.star-on, .post-footer .rating-stars #rating-stars img.star-on { background-color: #bf00ff; } </style> </div> <div class="et_pb_extra_row etad post_below"> <div class="adsense-responsive-ad"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- Ads 1 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-1299274443223272" data-ad-slot="9142535381" data-ad-format="auto"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script></div> </div> </article> <nav class="post-nav"> <div class="nav-links clearfix"> <div class="nav-link nav-link-prev"> <a href="http://gracemanaay.tk/2018/11/06/fun-tip-use-calc-to-change-the-height-of-a-hero-component/" rel="prev"><span class="button">Previous</span><span class="title">Fun Tip: Use calc() to Change the Height of a Hero Component</span></a> </div> <div class="nav-link nav-link-next"> <a href="http://gracemanaay.tk/2018/11/07/simplify-styling-with-functional-css/" rel="next"><span class="button">Next</span><span class="title">Simplify Styling with Functional CSS</span></a> </div> </div> </nav> <div class="et_extra_other_module author-box vcard"> <div class="author-box-header"> <h3>About The Author</h3> </div> <div class="author-box-content clearfix"> <div class="author-box-avatar"> <img alt='admin' src='http://2.gravatar.com/avatar/257188b3a69a55a508edb68808648625?s=170&d=mm&r=g' srcset='http://2.gravatar.com/avatar/257188b3a69a55a508edb68808648625?s=340&d=mm&r=g 2x' class='avatar avatar-170 photo' height='170' width='170' /> </div> <div class="author-box-description"> <h4><a class="author-link url fn" href="http://gracemanaay.tk/author/admin/" rel="author" title="View all posts by admin">admin</a></h4> <p class="note"></p> <ul class="social-icons"> </ul> </div> </div> </div> <div class="et_extra_other_module related-posts"> <div class="related-posts-header"> <h3>Related Posts</h3> </div> <div class="related-posts-content clearfix"> <div class="related-post"> <div class="featured-image"><a href="http://gracemanaay.tk/2017/10/13/writing-smarter-animation-code/" title="Writing Smarter Animation Code" class="post-thumbnail"> <img src="http://www.gracemanaay.tk/wp-content/themes/Extra/images/post-format-thumb-text.svg" alt="Writing Smarter Animation Code" /><span class="et_pb_extra_overlay"></span> </a></div> <h4 class="title"><a href="http://gracemanaay.tk/2017/10/13/writing-smarter-animation-code/">Writing Smarter Animation Code</a></h4> <p class="date"><span class="updated">October 13, 2017</span></p> </div> <div class="related-post"> <div class="featured-image"><a href="http://gracemanaay.tk/2017/11/17/how-to-disable-links/" title="How to Disable Links" class="post-thumbnail"> <img src="https://cdn.css-tricks.com/wp-content/uploads/2017/11/disabled-link.gif" alt="How to Disable Links" /><span class="et_pb_extra_overlay"></span> </a></div> <h4 class="title"><a href="http://gracemanaay.tk/2017/11/17/how-to-disable-links/">How to Disable Links</a></h4> <p class="date"><span class="updated">November 17, 2017</span></p> </div> <div class="related-post"> <div class="featured-image"><a href="http://gracemanaay.tk/2017/12/17/the-youth-these-days-couldnt-possibly-understand-the-abstraction-of-a-floppy-disk-for-a-save-icon/" title="The youth these days couldn’t possibly understand the abstraction of a floppy disk for a save icon." class="post-thumbnail"> <img src="http://www.gracemanaay.tk/wp-content/themes/Extra/images/post-format-thumb-text.svg" alt="The youth these days couldn’t possibly understand the abstraction of a floppy disk for a save icon." /><span class="et_pb_extra_overlay"></span> </a></div> <h4 class="title"><a href="http://gracemanaay.tk/2017/12/17/the-youth-these-days-couldnt-possibly-understand-the-abstraction-of-a-floppy-disk-for-a-save-icon/">The youth these days couldn’t possibly understand the abstraction of a floppy disk for a save icon.</a></h4> <p class="date"><span class="updated">December 17, 2017</span></p> </div> <div class="related-post"> <div class="featured-image"><a href="http://gracemanaay.tk/2018/02/01/javascript-i-love-you-youre-perfect-now-change/" title="JavaScript, I love you, you’re perfect, now change" class="post-thumbnail"> <img src="http://www.gracemanaay.tk/wp-content/themes/Extra/images/post-format-thumb-text.svg" alt="JavaScript, I love you, you’re perfect, now change" /><span class="et_pb_extra_overlay"></span> </a></div> <h4 class="title"><a href="http://gracemanaay.tk/2018/02/01/javascript-i-love-you-youre-perfect-now-change/">JavaScript, I love you, you’re perfect, now change</a></h4> <p class="date"><span class="updated">February 1, 2018</span></p> </div> </div> </div> <!-- You can start editing here. --> <section id="comment-wrap"> <div id="comments" class="nocomments"> <!-- If comments are open, but there are no comments. --> </div> <div id="respond" class="comment-respond"> <h3 id="reply-title" class="comment-reply-title"><span>Leave a reply</span> <small><a rel="nofollow" id="cancel-comment-reply-link" href="/2018/11/07/building-a-donut-chart-with-vue-and-svg/#respond" style="display:none;">Cancel reply</a></small></h3> <form action="http://www.gracemanaay.tk/wp-comments-post.php" method="post" id="commentform" class="comment-form"> <p class="comment-notes"><span id="email-notes">Your email address will not be published.</span> Required fields are marked <span class="required">*</span></p><p class="comment-form-comment"><label for="comment">COMMENT</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p><p class="comment-form-author"><label for="author">Name <span class="required">*</span></label> <input id="author" name="author" type="text" value="" size="30" maxlength="245" aria-required='true' required='required' /></p> <p class="comment-form-email"><label for="email">Email <span class="required">*</span></label> <input id="email" name="email" type="text" value="" size="30" maxlength="100" aria-describedby="email-notes" aria-required='true' required='required' /></p> <p class="comment-form-url"><label for="url">Website</label> <input id="url" name="url" type="text" value="" size="30" maxlength="200" /></p> <p class="form-submit"><input name="submit" type="submit" id="submit" class="submit" value="Post Comment" /> <input type='hidden' name='comment_post_ID' value='2318' id='comment_post_ID' /> <input type='hidden' name='comment_parent' id='comment_parent' value='0' /> </p> </form> </div><!-- #respond --> </section> </div><!-- /.et_pb_extra_column.et_pb_extra_column_main --> <div class="et_pb_extra_column_sidebar"> <div id="search-2" class="et_pb_widget widget_search"><h4 class="widgettitle"> </h4><form role="search" method="get" class="search-form" action="http://gracemanaay.tk/"> <label> <span class="screen-reader-text">Search for:</span> <input type="search" class="search-field" placeholder="Search …" value="" name="s" /> </label> <input type="submit" class="search-submit" value="Search" /> </form></div> <!-- end .et_pb_widget --> <div id="recent-posts-2" class="et_pb_widget widget_recent_entries"> <h4 class="widgettitle">Recent Posts</h4> <ul> <li> <a href="http://gracemanaay.tk/2018/11/15/scaling-css-two-sides-of-a-spectrum/">Scaling CSS: Two Sides of a Spectrum</a> </li> <li> <a href="http://gracemanaay.tk/2018/11/15/dramatically-speed-up-your-react-front-end-app-using-lazy-loading/">Dramatically Speed Up Your React Front-End App Using Lazy Loading</a> </li> <li> <a href="http://gracemanaay.tk/2018/11/15/design-better-ux-with-vue-js-transitions-and-animations/">Design Better UX With Vue.js Transitions and Animations</a> </li> <li> <a href="http://gracemanaay.tk/2018/11/14/write-to-files-and-read-files-with-php/">Write to Files and Read Files With PHP</a> </li> <li> <a href="http://gracemanaay.tk/2018/11/14/connect-to-an-api-with-retrofit-rxjava-2-and-kotlin/">Connect to an API With Retrofit, RxJava 2, and Kotlin</a> </li> </ul> </div> <!-- end .et_pb_widget --> <div id="et_social_followers-2" class="et_pb_widget widget_et_social_followers"><h4 class="widgettitle">Follow Us</h4> <div class="widget_content"> <ul class="widget_list"> <li> <a class="et-extra-icon et-extra-icon-facebook et-extra-icon-background social-icon" href="https://www.facebook.com/asensoBrgy2WomensSilay"></a> <a href="https://www.facebook.com/asensoBrgy2WomensSilay" class="widget_list_social"> <h3 class="title">Facebook</h3> </a> </li> <li> <a class="et-extra-icon et-extra-icon-googleplus et-extra-icon-background social-icon" href="https://plus.google.com/u/0/109536858712215471785"></a> <a href="https://plus.google.com/u/0/109536858712215471785" class="widget_list_social"> <h3 class="title">Google+</h3> </a> </li> <li> <a class="et-extra-icon et-extra-icon-youtube et-extra-icon-background social-icon" href="https://www.youtube.com/user/gracemanaay"></a> <a href="https://www.youtube.com/user/gracemanaay" class="widget_list_social"> <h3 class="title">Youtube</h3> </a> </li> <li> <a class="et-extra-icon et-extra-icon-twitter et-extra-icon-background social-icon" href="https://twitter.com/twittwitadik"></a> <a href="https://twitter.com/twittwitadik" class="widget_list_social"> <h3 class="title">Twitter</h3> </a> </li> <li> <a class="et-extra-icon et-extra-icon-instagram et-extra-icon-background social-icon" href="https://www.instagram.com/deez.grace/"></a> <a href="https://www.instagram.com/deez.grace/" class="widget_list_social"> <h3 class="title">Instagram</h3> </a> </li> </ul> </div> </div> <!-- end .et_pb_widget --></div> </div> <!-- #content-area --> </div> <!-- .container --> </div> <!-- #main-content --> <div class="container"> <div class="et_pb_extra_row etad footer_above"> <div class="adsense-responsive-ad"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- Ads 1 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-1299274443223272" data-ad-slot="9142535381" data-ad-format="auto"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script></div> </div> </div> <footer id="footer" class="footer_columns_3"> <div id="footer-bottom"> <div class="container"> <!-- Footer Info --> <p id="footer-info">Designed by <a href="http://www.elegantthemes.com" title="Premium WordPress Themes">Elegant Themes</a> | Powered by <a href="http://www.wordpress.org">WordPress</a></p> <!-- Footer Navigation --> <div id="footer-nav"> <ul class="et-extra-social-icons" style=""> <li class="et-extra-social-icon facebook"> <a href="https://www.facebook.com/grace.manaay" class="et-extra-icon et-extra-icon-background-none et-extra-icon-facebook"></a> </li> <li class="et-extra-social-icon twitter"> <a href="https://twitter.com/twittwitadik" class="et-extra-icon et-extra-icon-background-none et-extra-icon-twitter"></a> </li> <li class="et-extra-social-icon googleplus"> <a href="https://plus.google.com/u/0/109536858712215471785" class="et-extra-icon et-extra-icon-background-none et-extra-icon-googleplus"></a> </li> <li class="et-extra-social-icon instagram"> <a href="https://www.instagram.com/deez.grace/" class="et-extra-icon et-extra-icon-background-none et-extra-icon-instagram"></a> </li> <li class="et-extra-social-icon youtube"> <a href="https://www.youtube.com/user/gracemanaay" class="et-extra-icon et-extra-icon-background-none et-extra-icon-youtube"></a> </li> </ul> </div> <!-- /#et-footer-nav --> </div> </div> </footer> </div> <!-- #page-container --> <span title="Back To Top" id="back_to_top"></span> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-15295893-6', 'auto'); ga('send', 'pageview'); </script><script type='text/javascript' src='http://www.gracemanaay.tk/wp-content/themes/Extra/includes/builder/scripts/frontend-builder-global-functions.js?ver=2.0.61'></script> <script type='text/javascript' src='http://www.gracemanaay.tk/wp-includes/js/imagesloaded.min.js?ver=3.2.0'></script> <script type='text/javascript' src='http://www.gracemanaay.tk/wp-content/themes/Extra/scripts/ext/jquery.waypoints.min.js?ver=2.0.61'></script> <script type='text/javascript' src='http://www.gracemanaay.tk/wp-content/themes/Extra/scripts/ext/jquery.fitvids.min.js?ver=2.0.61'></script> <script type='text/javascript' src='http://www.gracemanaay.tk/wp-content/themes/Extra/scripts/ext/smoothscroll.min.js?ver=2.0.61'></script> <script type='text/javascript' src='http://www.gracemanaay.tk/wp-includes/js/masonry.min.js?ver=3.3.2'></script> <script type='text/javascript' src='http://www.gracemanaay.tk/wp-content/themes/Extra/includes/builder/scripts/salvattore.min.js?ver=2.0.61'></script> <script type='text/javascript'> /* <![CDATA[ */ var EXTRA = {"images_uri":"http:\/\/www.gracemanaay.tk\/wp-content\/themes\/Extra\/images\/","ajaxurl":"http:\/\/www.gracemanaay.tk\/wp-admin\/admin-ajax.php","your_rating":"Your Rating:","item_in_cart_count":"%d Item in Cart","items_in_cart_count":"%d Items in Cart","item_count":"%d Item","items_count":"%d Items","rating_nonce":"958fc591b0","timeline_nonce":"8d982e6c13","blog_feed_nonce":"099697a46b","error":"There was a problem, please try again.","contact_error_name_required":"Name field cannot be empty.","contact_error_email_required":"Email field cannot be empty.","contact_error_email_invalid":"Please enter a valid email address.","is_ab_testing_active":"","is_cache_plugin_active":"no"}; /* ]]> */ </script> <script type='text/javascript' src='http://www.gracemanaay.tk/wp-content/themes/Extra/scripts/scripts.min.js?ver=2.0.61'></script> <script type='text/javascript' src='http://www.gracemanaay.tk/wp-includes/js/comment-reply.min.js?ver=4.8.7'></script> <script type='text/javascript' src='http://www.gracemanaay.tk/wp-content/themes/Extra/scripts/ext/jquery.raty.min.js?ver=2.0.61'></script> <script type='text/javascript' src='http://www.gracemanaay.tk/wp-content/themes/Extra/includes/builder/scripts/jquery.fitvids.js?ver=2.0.61'></script> <script type='text/javascript' src='http://www.gracemanaay.tk/wp-content/themes/Extra/includes/builder/scripts/jquery.magnific-popup.js?ver=2.0.61'></script> <script type='text/javascript' src='http://www.gracemanaay.tk/wp-content/themes/Extra/includes/builder/scripts/jquery.mobile.custom.min.js?ver=2.0.61'></script> <script type='text/javascript'> /* <![CDATA[ */ var et_pb_custom = {"ajaxurl":"http:\/\/www.gracemanaay.tk\/wp-admin\/admin-ajax.php","images_uri":"http:\/\/www.gracemanaay.tk\/wp-content\/themes\/Extra\/images","builder_images_uri":"http:\/\/www.gracemanaay.tk\/wp-content\/themes\/Extra\/includes\/builder\/images","et_frontend_nonce":"446716e157","subscription_failed":"Please, check the fields below to make sure you entered the correct information.","et_ab_log_nonce":"a99f1e9157","fill_message":"Please, fill in the following fields:","contact_error_message":"Please, fix the following errors:","invalid":"Invalid email","captcha":"Captcha","prev":"Prev","previous":"Previous","next":"Next","wrong_captcha":"You entered the wrong number in captcha.","is_builder_plugin_used":"","ignore_waypoints":"no","is_divi_theme_used":"","widget_search_selector":".widget_search","is_ab_testing_active":"","page_id":"2318","unique_test_id":"","ab_bounce_rate":"5","is_cache_plugin_active":"no","is_shortcode_tracking":""}; /* ]]> */ </script> <script type='text/javascript' src='http://www.gracemanaay.tk/wp-content/themes/Extra/includes/builder/scripts/frontend-builder-scripts.js?ver=2.0.61'></script> <script type='text/javascript' src='http://www.gracemanaay.tk/wp-includes/js/wp-embed.min.js?ver=4.8.7'></script> <script type='text/javascript' src='http://www.gracemanaay.tk/wp-content/plugins/featured-image-from-url/includes/html/js/jquery.lazyloadxt.extra.js?ver=4.8.7'></script> <div style='text-align: right;position: fixed;z-index:9999999;bottom: 0; width: 100%;cursor: pointer;line-height: 0;display:block !important;'><a title="000webhost logo" rel="nofollow" target="_blank" href="https://www.000webhost.com/?utm_source=000webhostapp&utm_campaign=000_logo&utm_campaign=ss-footer_logo&utm_medium=000_logo&utm_content=website"><img src="https://cdn.rawgit.com/000webhost/logo/e9bd13f7/footer-powered-by-000webhost-white2.png" alt="000webhost logo"></a></div></body> </html>