Jump to content
JChartFX Community
  • 0
roberthow

can not show picture with AnnotationPicture

Question



my code:

function loadChart() {

    var chart1 = new cfx.Chart();

    chart1.getData().setSeries(1);

    chart1.getData().setPoints(4);

    chart1.getAllSeries().setGallery(cfx.Gallery.Pie);

var ann = new cfx.annotation.Annotations();

var annList = ann.getList();

var annPic = new cfx.annotation.AnnotationPicture();

annPic.setPicture("images/dx.jpg");

//annPic.setMode(cfx.AnnImageMode.Tile);

annPic.setWidth(370);

annPic.setHeight(445);

annPic.setLeft(50);

annPic.setTop(50);

annList.add(annPic);

chart1.getExtensions().add(ann);

    var divHolder = document.getElementById('ChartDiv');

    chart1.create(divHolder);

}

---------------------------------------------------------------

the problem is  the Pie Chart shows correctly, but annotation picture can not show, it just show as a rectangle.

There are too little documentation about Annotation APIs in http://support.softwarefx.com/jChartFX/api for reference.

does any one can let me know what's wrong with the code?

 

Another Problem is the comment line in the code ( //annPic.setMode(cfx.AnnImageMode.Tile); ), if I uncomment that line and run the code,

the brower will not show the pie chart and throw error message "Unable to get value of the property 'Tile': object is null or undefined".

There is already include jchartfx.annotation.js in my code. anyone can help me?

my system is win7, brower is IE 9, jChartFX version is 7.1.5044.21402 

Thanks. 

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

1) Because of how our code was originally written, you have to specify the original width and height of the image as part of the image URL as follows

annPic.setPicture("images/dx,24,48"); // 24 is the width, 48 is the height

2) To remove the border you can use 

annPic.getBorder().setColor("#00FFFFFF");

3) The enumeration AnnImageMode did not get declared in the current build (we will fix this in future builds), for now you can use 0 for default, 1 for stretch and 2 for tile. 

Regards,

JuanC 

Share this post


Link to post
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...

×
×
  • Create New...