Jump to content
JChartFX Community
  • 0

Bubble chart series name


igor@sphereup.com
 Share

Question

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

  • 0

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 

Link to comment
Share on other sites

  • 0

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. 

Link to comment
Share on other sites

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...