Jump to content
JChartFX Community

greg.valainis@pa-tech.com

Members
  • Content count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About greg.valainis@pa-tech.com

  • Rank
    Newbie
  1. Change Legend Items on pareto chart

    I am trying to style a pareto but have run into a problem with the legend. I change the bars of the pareto chart to be a different color than the default. This works fine. However the associated legend item does not change color either. I want the square that represents the data in graph to change as well. This only half way works. The outline of said square has changed color, but the fill is white. I want the fill to be this custom color, too. Thank you for your help. Here is the code used to create the graph: <div id="ChartDiv" style="width:400px;height:400px;"> </div> <script> $(document).ready(function(){ var data = [{"Location": "Main Street", "Number of Computers", 4}, {"Location": "Church Street", "Number of Computers", 3}, {"Location": "North Street", "Number of Computers", 1}]; var chart1 = new cfx.Chart(); chart1.setDataSource(data); chart1.setGallery(cfx.Gallery.Pareto); chart1.getSeries().getItem(0).setColor("#a12339"); chart1.setBackColor("#f5faeb"); chart1.getBorder().setColor("#f5faeb"); chart1.setBorder(cfx.SimpleBorder); chart1.getView3D().setEnabled(true); chart1.create("ChartDiv"); var heading = new cfx.Title; heading.setText("Locations with Computers"); chart1.getTitles().add(heading); chart1.getLegendBox().setDock(cfx.DockArea.Bottom); chart1.getLegendBox().setContentLayout(cfx.ContentLayout.Near); }); </script>
  2. Changing Legend Item Colors

    Never mind. Answer in previous post.
  3. Changing Legend Item Colors

    I just changed the colors of the individual pie slices using the following code: chart1.getPoints().getItem(0,0).setColor("#9bcb3e"); chart1.getPoints().getItem(0,1).setColor("#fbd91d"); chart1.getPoints().getItem(0,2).setColor("#fb5e1d"); How can I change the rectangles in the legend to match?
×