| Page 1 of 1 | [ 2 posts ] |
|
Hi, I'm changing my series colors how Tripp explained in viewtopic.php?f=92&t=10316&e=0 , but my legend colors are not changing, someone can help me?
This is my code: var myChart = new Y.Chart({ type: typeChart, legend: { position: "right", width: 300, height: 300, styles: { hAlign: "center", hSpacing: 4 } }, axes: { category: { keys: [pCategoryKey], type: "category", styles: { label: { rotation: -45 } } } }, categoryKey: pCategoryKey, dataProvider:dataSource, horizontalGridlines: true, verticalGridlines: true, render:renderId }); myChart.set("styles", { series: [ { fill: { color: "#41ab5d" } }, { fill: { color: "#4eb3d3" } }, { fill: { color: "#ef6548" } } ]}); |
|
There is currently bug when using the global style object and a legend.
http://yuilibrary.com/projects/yui3/ticket/2532235 Manually forcing a redraw after updating your styles should workaround this issue. Code: myChart.set("styles", { series: [ { fill: { color: "#41ab5d" } }, { fill: { color: "#4eb3d3" } }, { fill: { color: "#ef6548" } } ]}); myChart.get("legend")._drawLegend(); Alternatively, you can set your colors when instantiating your chart. Code: var myChart = new Y.Chart({ type: typeChart, ... seriesCollection: [ { xKey: pCategoryKey, yKey: seriesKey1, styles: { fill: { color: "#41ab5d" } } }, ... ], ... }); 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