guruvaarun Posted October 8, 2013 Report Share Posted October 8, 2013 How can we give the user preferred color to the 3Dcharts. i need the 3D charts with user preferred colors to the charts without default colors. And also different colors to the each bar in 3D barchart Quote Link to comment Share on other sites More sharing options...
0 JuanC Posted October 8, 2013 Report Share Posted October 8, 2013 Not sure what your question means. Can you please expand on what you mean by "give the user preferred color to the 3D charts"? Is this the same question that was posted in the Styling forum about colors in CSS? Regards, JuanC Quote Link to comment Share on other sites More sharing options...
0 guruvaarun Posted October 9, 2013 Author Report Share Posted October 9, 2013 From the json user gives the color to the individual bars such as [ { "Sales": 2,"Month":"Jan","color":"#000000"}, { "Sales": 2,"Month":"Feb" ,"color":"#0afbaf"}, { "Sales": 5, "Month": "Mar" ,"color":"#c0f0f0"}, { "Sales": 1, "Month": "Apr" ,"color":"#d0f0d0"}, { "Sales": 8, "Month": "May" ,"color":"#aaaaaa"}, { "Sales": 5, "Month": "Jun" ,"color":"#110101"}, ] by using the setcolor() method i can able to change the default color to user specified color. But in the legends i am getting the default color and single value only displayed init. for more details see this example. http://jsfiddle.net/Fe3Qt/ Quote Link to comment Share on other sites More sharing options...
0 JuanC Posted October 9, 2013 Report Share Posted October 9, 2013 You need 2 things, - Use the setMultipleColors so that we know the chart will be displayed one color per point, note that as soon as you do this and even if you do not set your own colors, each point will use a different color. this.chart.getAllSeries().setMultipleColors(true); - Change the index of the series from 0 to -1 inside the loop where you set the colors for each bar, this tells us that the particular attribute applies to all series (in case there is more than 1) so it will appear in the legend box this.chart.getPoints().getItem(-1,i).setColor(this.config.items.color); Regards, JuanC Quote Link to comment Share on other sites More sharing options...
0 guruvaarun Posted October 10, 2013 Author Report Share Posted October 10, 2013 Thanks JuanC working fine Quote Link to comment Share on other sites More sharing options...
Question
guruvaarun
How can we give the user preferred color to the 3Dcharts.
i need the 3D charts with user preferred colors to the charts without default colors. And also different colors to the each bar in 3D barchart
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.