| Page 1 of 1 | [ 6 posts ] |
|
I have a single set of bars on a column chart that looks like this:
http://imgur.com/F2IG5 I want to show the name of each individual player on the x-axis under each bar instead of showing the category name (e.g. "Players"). I've tried a bunch of different ways and can't get it to work. Any ideas? |
|
You could try include all players as its own category in a single series. You can still get different colored bars by setting an array of colors for the markers. I am not sure of the structure of you dataProvider but something like the below code may work for you.
Code: var dataProvider = [ {player: "Player1", value: 444}, {player: "Player2", value: 333}, ... ], mychart = new Y.Chart({ type: "column", seriesCollection: [ xKey: "player", yKey: "value", styles: [ marker: { fill: { color: ["#fco", "#9aa", ...] } } ] ], render: "#mychart" }); Thanks, Tripp |
|
I got this working with 3.5.1: http://jsfiddle.net/ptvkm/
HOWEVER, I need this to run with 3.4.1 and the same code breaks: http://jsfiddle.net/VNz2W/ Any ideas? |
|
Here's a gist to a patch I made for this bug before the 3.5 release.
https://gist.github.com/1299428 Add this code at the start of your yui code block and you should get the correct results in 3.4.1. Code: YUI().use('charts', function(Y) { //patch code goes here //you code goes here }); Thanks, Tripp |
|
Awesome. Thanks Tripp!
Are there any issues if I put that code in a function and call it like this: http://jsfiddle.net/VNz2W/3/ |
|
That should be fine.
Tripp |
| Page 1 of 1 | [ 6 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