Jump to content
JChartFX Community

sivaraj

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About sivaraj

  • Rank
    Newbie
  1. Hi Guys, I am trying to change the order of legend labels. But able to change using orderIndex. Please find below code which i tried. can u please suggest some way to changethe order.. so that i can get "% Accepted" label to be the last in legend(only in legend, not in series). Code: var chart1 = new cfx.Chart(); var items = [{"Date":"Feb 26","% Accepted":0,"Offered":0,"Accepted":0},{"Date":"Feb 27","% Accepted":0,"Offered":0,"Accepted":0},{"Date":"Feb 28","% Accepted":0,"Offered":0,"Accepted":0},{"Date":"Mar 1","% Accepted":0,"Offered":0,"Accepted":0},{"Date":"Mar 2","% Accepted":0,"Offered":0,"Accepted":0},{"Date":"Mar 3","% Accepted":0,"Offered":0,"Accepted":0},{"Date":"Mar 4","% Accepted":66.66666666666666,"Offered":3,"Accepted":2}]; chart1.setDataSource(items); // chart1.setGallery(cfx.Gallery.Lines); var lia1 = new cfx.LegendItemAttributes(); lia1.setOrderIndex(2); var lia2 = new cfx.LegendItemAttributes(); lia2.setOrderIndex(0); lia2.setVisible(false); var lia3 = new cfx.LegendItemAttributes(); lia3.setOrderIndex(1); chart1.getLegendBox().getItemAttributes().setItem(chart1.getSeries(), 0, lia2); // chart1.getLegendBox().getItemAttributes().setItem(chart1.getSeries(), 2, lia3); // chart1.getLegendBox().getItemAttributes().setItem(chart1.getSeries(), 0, lia1); series3 = chart1.getSeries().getItem(0); series1 = chart1.getSeries().getItem(1); series2 = chart1.getSeries().getItem(2); series1.setGallery(cfx.Gallery.Bar); series2.setGallery(cfx.Gallery.Bar); series3.setGallery(cfx.Gallery.Line); series3.getPointLabels().setFormat("%v%%"); var axis2 = chart1.getAxisY2(); axis2.setVisible(true); axis2.getGrids().getMajor().setVisible(false); axis2.getLabelsFormat().setDecimals(1); series3.setAxisY(axis2); var divHolder = document.getElementById('ChartDiv'); chart1.create(divHolder);
×
×
  • Create New...