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.
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.
Question
greg.valainis@pa-tech.com
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>
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.