HTMLify
csscharts.css
Views: 7 | Author: cody
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 | /* * cssCharts v0.3.0 * jquery plugin to create donut and bar charts with css * https://github.com/sultantarimo * * (c)2015 Sultan Tarimo - sultantarimo@me.com * Released under the MIT license */ .chart *, .chart{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;} .chart{ width:auto; display:block; position:relative; font-family:sans-serif; font-size:14px; margin: 0 auto; } /* bar chart */ .chart.bar{height:200px;} .bar-chart{ display: table; table-layout: fixed; width: auto; height: 100%; margin: 0 auto; z-index:20; position:absolute; left:0px; } .bar-chart ul{ margin-left: 34px; float: left; display: block; height:100%; } .bar-chart li{ position: relative; display: table-cell; vertical-align: bottom; height: 100px; } .bar-chart span{ margin: 0 6px; display: block; background: rgb(241,127,73); width: 34px; position:relative; -webkit-animation: drawBar 0.3s ease-in-out; -moz-animation: drawBar 0.3s ease-in-out; animation: drawBar 0.3s ease-in-out; -webkit-transition: all 100ms ease-in-out; -moz-transition: all 100ms ease-in-out; transition: all 100ms ease-in-out; } .bar-chart li:hover span{ box-shadow:0 0 0 4px rgb(241,127,73); cursor:pointer; } .bar-chart li:nth-child(2n+1):hover span{ box-shadow:0 0 0 4px #bd380f; } .bar-chart li:nth-child(2n+1) span{background-color:#bd380f;} .bar-chart ul:last-of-type li:last-child span{margin-right:0px;} .bar-chart ul:first-of-type li:first-child span{margin-left:0px;} .bar-chart ul:last-of-type {margin-right: 0px;} .bar-chart ul:first-of-type {margin-left: 0px;} .bar-chart.left-bar ul:last-of-type {margin-right: 0px;} .bar-chart.left-bar ul{margin-right: 34px;float:left;margin-left:0px;} .bar-chart span:before { position: absolute; bottom: 100%; margin-bottom: 10px; display: block; text-align: center; content: attr(title); word-wrap: break-word; font-size: 12px; width: auto; left: 50%; -webkit-transform: translateX(-50%); -moz-transform: translateX(-50%); transform: translateX(-50%); } .bar-chart li span:before { -webkit-transition: all 100ms ease-in-out; -moz-transition: all 100ms ease-in-out; transition: all 100ms ease-in-out; } @-webkit-keyframes drawBar {0% {height: 0;}} @-moz-keyframes drawBar {0% {height: 0;}} @keyframes drawBar {0% {height: 0;}} /* donut chart */ .chart.donut{ width:200px; height:200px; } .donut-chart{ width:100%;height:100%; position:relative; -webkit-border-radius:50%; -moz-border-radius:50%; border-radius:50%; } .donut-chart.fill{ background:rgb(241,127,73); } .donut-chart:after{ content:""; position: absolute; width: 86%; height: 86%; background: #FFF; left: 50%; top: 50%; z-index: 400; margin: 0 auto; pointer-events: none; -webkit-border-radius: 100%; -moz-border-radius: 100%; border-radius: 100%; -webkit-transform: translateX(-50%) translateY(-50%); -moz-transform: translateX(-50%) translateY(-50%); transform: translateX(-50%) translateY(-50%); } .donut-chart h2{ text-align:center; position: absolute; line-height: 140%; width: 100%; margin-top:-30px; top:50%; z-index:500; pointer-events: none; font-size:26px; font-weight:400; color:rgb(0,0,0); } .donut-chart h2 span{ display:block; width:100%; font-size:14px; color:rgb(142,143,143); margin-top:-10px; } .donut-chart .spinner{ z-index: 200; border-right: none; -webkit-border-radius: 100% 0 0 100% / 50% 0 0 50%; -moz-border-radius: 100% 0 0 100% / 50% 0 0 50%; border-radius: 100% 0 0 100% / 50% 0 0 50%; -webkit-transform: rotate(0deg); -moz-transform: rotate(0deg); transform: rotate(0deg); -webkit-animation: rotateDonut 0.3s ease-in-out; -moz-animation: rotateDonut 0.3s ease-in-out; animation: rotateDonut 0.3s ease-in-out; -webkit-transition: all 160ms ease-in-out; -moz-transition: all 160ms ease-in-out; transition: all 160ms ease-in-out; } .spinner ~ .pie{ pointer-events: none; } .donut-chart.fill .pie, .pie-chart .pie{ -webkit-box-shadow: 0 0 0 4px #bd380f; -moz-box-shadow: 0 0 0 4px #bd380f; box-shadow: 0 0 0 4px #bd380f; } @-webkit-keyframes rotateDonut {0% {transform: rotate(0deg);}} @-moz-keyframes rotateDonut {0% {transform: rotate(0deg);}} @keyframes rotateDonut {0% {transform: rotate(0deg);}} .donut-chart .spinner.temp{display:none;} .donut-chart .pie{ width: 50%; height: 100%; position: absolute; background: #bd380f; -webkit-transform-origin: 100% 50%; -moz-transform-origin: 100% 50%; transform-origin: 100% 50%; } .donut-chart .mask{ background:rgb(248,248,248); z-index: 400; margin-left: -1px; } .pie-chart:after{ display:none; } .chart.donut .pie-chart h2, .chart.donut .pie-chart h2 span{color:#FFF;} /* pie chart */ .chart.pie svg{width:100%;height:100%;} .chart.pie { width: 200px; height: 200px; } .chart.pie svg text{ text-anchor: middle; fill:white; stroke-width:0; transform:translate(120,-80); } .chart.pie svg path:hover{ stroke-width:10px; } .charts-tip{ display:block; position: absolute; font-size: 16px; color: #FFF; background: rgba(0,0,0,0.8); pointer-events: none; font-family:sans-serif; padding:6px 12px; z-index:100; width:auto; -webkit-border-radius:4px; -moz-border-radius:4px; border-radius:4px; } .chart.pie .pie-legend{ position:absolute; top:50%; right:0; margin-right:-30px; transform:translateX(100%) translateY(-50%); } .chart.pie .pie-legend li{ display:block; margin-bottom:14px; clear:both; } .chart.pie .pie-legend li i{ top:1px; position:relative; display:block; float:left; width:14px; height:14px; background:#DDD; margin-right:10px; box-shadow:inset 0 0 0 1px rgba(0,0,0,0.2); } .chart.pie .pie-legend li p{clear:both;display:inline;} /* pie chart */ /* line chart */ .chart.line{width:auto;height:auto;margin:0 auto;position:relative;} .chart .line-chart{ min-width:100px; min-height:100px; width:100%; height:100%; margin:0px auto; display:block; position:relative; z-index:20; } /* line chart borders and grids */ .line-chart:after{ content:""; display:block; position:absolute; left:0px;bottom:0px; height:1px;width:100%; background:rgb(238,238,238); padding-right:10px; } .chart .grid{ width:100%; height:100%; position:absolute; left:0px; bottom:0px; } .chart hr{ position:absolute; left:0px; bottom:0px; width:100%; height:1px; outline:none; border:none; background:rgb(238,238,238); } .chart hr:before{ position:absolute; right:100%; top:0px; margin-right:20px; color:rgba(0,0,0,0.4); font-size:12px; content:attr(data-y); text-align:right; -webkit-transform:translateX(-50%) translateY(-50%); -moz-transform:translateX(-50%) translateY(-50%); transform:translateX(-50%) translateY(-50%); } /* line chart borders and grids */ /* line chart line */ .line-chart li{ display:block;height:1px; float:left;position:relative; position:absolute; } /* line chart points tooltip */ .line-chart li a:hover:before, .line-chart li a:hover:after{display:block;z-index:10;} .line-chart li a:before{ content:attr(data-y); cursor:pointer; display:none; position:absolute; font-size:14px; color:#FFF; bottom:100%; left:50%; margin-bottom:-4px; text-align:center; width:40px; background:rgba(0,0,0,0.8); padding:8px; z-index:40; -webkit-transform:translateX(-50%); -moz-transform:translateX(-50%); transform:translateX(-50%); -webkit-border-radius:3px; -moz-border-radius:3px; border-radius:3px; } .line-chart li a:after{ z-index:50; content:""; width: 0; height: 0; display:none; position:absolute; bottom:100%; left:50%; margin-bottom:-16px; border:6px solid rgba(0,0,0,0); border-top: 6px solid rgba(0,0,0,0.8); -webkit-transform:translateX(-50%); -moz-transform:translateX(-50%); transform:translateX(-50%); } .line-chart li a{ display:block; position:absolute; cursor:pointer; width:40px; height:40px; left:0px; top:0px; z-index:30; -webkit-transform:translateX(-50%) translateY(-50%); -moz-transform:translateX(-50%) translateY(-50%); transform:translateX(-50%) translateY(-50%); } /* line chart points tooltip */ /* line chart points */ .line-chart li span{ display:block;height:1px; background:rgb(241,127,73); float:left; position:absolute; } .line-chart.no-points li span{ display:none; } .line-chart li span:before{ content:""; position:absolute; left:-4px;bottom:-4px; width:6px;height:6px; display:block; -webkt-border-radius:50%; -moz-border-radius:50%; border-radius:50%; } .line-chart li:hover span:before{ -webkit-transform:scale(1.3); -moz-transform:scale(1.3); transform:scale(1.3); -webkit-transition: all 200ms ease-in-out; -moz-transition: all 200ms ease-in-out; transition: all 200ms ease-in-out; } .line-chart li span:before, .line-chart li span:after{ background:rgb(241,127,73); border:2px solid #bd380f; -webkit-box-shadow:0 0 0 4px #FFF; -moz-box-shadow:0 0 0 4px #FFF; box-shadow:0 0 0 4px #FFF; } /* line chart points */ /* line chart line */ .chart.line svg, .chart.line > div{ height: 100%; width: 100%; position:absolute; bottom:0px; left:0px; opacity:1; -webkit-animation: drawLine .3s ease-in-out; -moz-animation: drawLine .3s ease-in-out; animation: drawLine .3s ease-in-out; } .chart.line svg path{ fill: rgba(241,127,73,0.0); stroke: rgb(241,127,73); stroke-width: 2px; } .chart.line.dotted svg path{ /*if you want it dashed instead of filled*/ stroke-dasharray: 3; } .chart.line .fill svg path{ fill: rgba(241,127,73,0.1); stroke:none; stroke-width:0px; } /* line chart animation */ @-webkit-keyframes drawLine {0% {opacity: 0;}} @-moz-keyframes drawLine {0% {opacity: 0;}} @keyframes drawLine {0% {opacity: 0;}} @-webkit-keyframes drawChart {0% {width: 0;}} @-moz-keyframes drawChart {0% {width: 0;}} @keyframes drawChart {0% {width: 0;}} |