Skip to main content
100%

INSTALL

✓ Published0🌍 Public
Aabernier
Last edited Apr 24, 2014
Created on Feb 15, 2013

PAC0SS is a playful demonstration of creating pie charts entirely with CSS, animated via JavaScript. It uses a Pac-Man-themed design to illustrate how a simple `<span>` element can be transformed into a dynamic pie chart by rotating two half-circle pseudo-elements. The example includes an interactive slider that lets users adjust the chart’s value from 0 to 360 degrees, with the pie updating live. Rendering is handled with SVG-based CSS transforms, and the code is structured for both client-side use with jQuery and server-side use via npm. The visualization showcases the versatility of CSS for data representation in a retro, game-inspired aesthetic.

AI-generated description

DEMO is here: http://bl.ocks.org/abernier/raw/4961058/

Explanation here: http://stackoverflow.com/questions/2280127/css-pie-charts#answer-15015424

INSTALL

client-side

<link rel="stylesheet" href="https://gist.githubusercontent.com/abernier/4961058/raw/index.css">

<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="https://gist.githubusercontent.com/abernier/4961058/raw/index.js"></script>
<script>
var mypie = new Pacss('#mypie');
</script>

server-side

npm install https://gist.github.com/abernier/4961058/download

then simply:

var pacss = require('pacss');
new Pacss('#mypie')
ISC Licensed

Similar vizzes