sgatade Posted June 13, 2014 Report Share Posted June 13, 2014 I have a single series on my chart which depicts 3 different levels of authentications in a day... chartMaster = new cfx.Chart(); var data = [1,7,46]; chartMaster.getLegendBox().setVisible(false); chartMaster.getAllSeries().getPointLabels().setVisible(true); chartMaster.setDataSource(data); chartMaster.setGallery(cfx.Gallery.Bar); chartMaster.getAxisY().setMin(0); chartMaster.getAxisY().setMax(50); chartMaster.getAxisX().getLabels().setItem(0, "EXECO"); chartMaster.getAxisX().getLabels().setItem(1, "MGMT"); chartMaster.getAxisX().getLabels().setItem(2, "EMP"); chartMaster.getSeries().getItem(0).setColor("#CC008B"); var divHolderMaster = document.getElementById('DivGraph'); chartMaster.create(divHolderMaster); I want to show these 3 bars in different colors. How to do this? Thanks in advance.... Quote Link to comment Share on other sites More sharing options...
0 JuanC Posted July 2, 2014 Report Share Posted July 2, 2014 Note the use of -1 when using getItem to modify the color for all series of the particular point. Even though you only have 1 series, it is better to use this in case you decide to show the legend box. chart1.getAllSeries().setMultipleColors(true); var points = chart1.getPoints(); points.getItem(-1, 0).setColor("#FF0000"); points.getItem(-1, 1).setColor("#00FF00"); points.getItem(-1, 2).setColor("#FFFF00"); JuanC Quote Link to comment Share on other sites More sharing options...
Question
sgatade
I have a single series on my chart which depicts 3 different levels of authentications in a day...
chartMaster = new cfx.Chart();
var data = [1,7,46];
chartMaster.getLegendBox().setVisible(false);
chartMaster.getAllSeries().getPointLabels().setVisible(true);
chartMaster.setDataSource(data);
chartMaster.setGallery(cfx.Gallery.Bar);
chartMaster.getAxisY().setMin(0);
chartMaster.getAxisY().setMax(50);
chartMaster.getAxisX().getLabels().setItem(0, "EXECO");
chartMaster.getAxisX().getLabels().setItem(1, "MGMT");
chartMaster.getAxisX().getLabels().setItem(2, "EMP");
chartMaster.getSeries().getItem(0).setColor("#CC008B");
var divHolderMaster = document.getElementById('DivGraph');
chartMaster.create(divHolderMaster);
I want to show these 3 bars in different colors. How to do this?
Thanks in advance....
Link to comment
Share on other sites
1 answer 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.