| Page 1 of 1 | [ 2 posts ] |
|
I was just wondering , is it possible to create donut charts in YUI by modifying the pie chart, i looked at the API docs but cannot find any way of creating them
|
|
Currently, there is no DonutSeries. Please file ticket and I will add one. Since a donut is a pie with a different drawing algorithm, you could alter or extend the pie to create a donut. If you wanted to create a donut, you could look into altering
PieChart and PieSeries. You would also need to create a custom shape for the donut "slices". If you wanted to do something quick and dirty, you could be place a circle over the center of a pie with the same background color as your container. Below is a method demonstrating this approach. You would pass it the same config object you would normally pass to the Chart object. Code: function getDonutChart(cfg) { var pieGraph = new Y.Chart(cfg), graphic = pieGraph.get("graph").get("graphic"), w = graphic.get("width"), h = graphic.get("height"), autoDraw = graphic.get("autoDraw"), hole; graphic.set("autoDraw", true); hole = graphic.addShape({ type: "circle", radius: w/4, x: w/4, y: h/4, fill: { color: "#fff" }, stroke:{ weight: 0 } }); graphic.set("autoDraw", autoDraw); return pieGraph; } Thanks, Tripp |
| Page 1 of 1 | [ 2 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group