igor@sphereup.com Posted January 15, 2014 Report Share Posted January 15, 2014 Hi, Can you please show me how to set JSON object to the bubble chart, so at the legend will see the correct lables (instead Poin1, Point2 etc). My JSON data sample: var data = [{ "X": 1, "Y": 1, "Size": 13, "Label": "Click Link" }, { "X": 2, "Y": 2, "Size": 2, "Label": "Click Banner" }, { "X": 3, "Y": 3, "Size": 1, "Label": "Click Phone Icon" }, { "X": 4, "Y": 4, "Size": 1, "Label": "Send Email" }]; Thanks. Quote Link to comment Share on other sites More sharing options...
0 JuanC Posted January 16, 2014 Report Share Posted January 16, 2014 I don't think we can easily show the labels in an XY bubble, I noticed your X goes 1, 2, 3, 4, if this means you really want your bubbles equally spaced you could this: var fields = chart1.getDataSourceSettings().getFields(); fields.clear(); var field; field = new cfx.FieldMap(); field.setName("Label"); field.setUsage(cfx.FieldUsage.Label); fields.add(field); field = new cfx.FieldMap(); field.setName("Y"); field.setUsage(cfx.FieldUsage.Value); fields.add(field); field = new cfx.FieldMap(); field.setName("Size"); field.setUsage(cfx.FieldUsage.Value); fields.add(field); chart1.setDataSource(data); chart1.setGallery(cfx.Gallery.Bubble); chart1.getAllSeries().setMultipleColors(true); JuanC Quote Link to comment Share on other sites More sharing options...
0 igor@sphereup.com Posted January 19, 2014 Author Report Share Posted January 19, 2014 Thanks for your reply, but it seems that i was not clear enough. I need: 1. To set JSON object to the bubble chart as dataset (see example above). 2. To show the "Label" attribute at legend, So instead hard-coded Point 1, Point 2 and etc. To show: "Click Link", "Click Banner" and etc. 3. If possible to show lable on bubble itself. Thanks, Igor. Quote Link to comment Share on other sites More sharing options...
0 JuanC Posted January 23, 2014 Report Share Posted January 23, 2014 As i said before there is no easy way today for showing the Labels in the legend box of an XY bubble, but if your X values are equally spaced, the code I posted in my previous message should generate the chart you need. JuanC Quote Link to comment Share on other sites More sharing options...
Question
igor@sphereup.com
Hi,
Can you please show me how to set JSON object to the bubble chart,
so at the legend will see the correct lables (instead Poin1, Point2 etc).
My JSON data sample:
var data = [{
"X": 1,
"Y": 1,
"Size": 13,
"Label": "Click Link"
}, {
"X": 2,
"Y": 2,
"Size": 2,
"Label": "Click Banner"
}, {
"X": 3,
"Y": 3,
"Size": 1,
"Label": "Click Phone Icon"
}, {
"X": 4,
"Y": 4,
"Size": 1,
"Label": "Send Email"
}];
Thanks.
Link to comment
Share on other sites
3 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.