Jump to content
Software FX Community
rubyrubin

Annotations?

Recommended Posts

 I am experimenting with the demo of ChartFX for Java Server.  I've seen a couple of blurbs about annotations and wanted to see its capabilities. Unfortunately, I cannot find the extension.  Where can I find it?  Thanks!

 - Aaron

 p.s. I was mostly interested in the annotations the  user can put on the chart and wanted to be able to save them (if possible).

Share this post


Link to post
Share on other sites

Annotation should be available within the chartfx.annotation.jar

You can find this jar a the Web-INF/Lib folder at your samples.

For code snippets, please refer to this links:

http://support.softwarefx.com/OnlineDoc/CfxJava65//

http://support.softwarefx.com/OnlineDoc/CfxJava65//guide/includingannotationextension.htm

You can also check the samples that came with the Chart FX.

 

If you need further assistance, please let me know.

Share this post


Link to post
Share on other sites

 That .jar doesn't exist there.  I am actually using chartfx7 (does that affect where it lives?)  (I didn't post to the ChartFX 7 group, since it didn't have an "extenstions" folder to post to.

Share this post


Link to post
Share on other sites

 I found it.  It actually resides in com.softwarefx.chartfx.server.annotation. 

 

The code  snippet in the programmer's guide shows the following (and many more lines of code after it):

 

Annotation.Annotations annots;
annots = new Annotation.Annotations();
 .
.
.
 
I changed the upper cases to lower cases as follows:
 
annotation.Annotations annots;
annots = new annotation.Annotations(); 

 

Share this post


Link to post
Share on other sites

 Also, later on in the same code snippet, it calls "arrow.Attach(2,0,50.0)", however there is no method "Attach".  I changed it to the lower case "attach".  I wonder how this sample ever ran?

Share this post


Link to post
Share on other sites

 Ok, On Chart FX 7, annotations comes as part of the com.softwarefx.chartfx.server namespace included in the ChartFX70.Server.jar file.

In the Chart FX 7 samples you can find more samples like this one.

 Please look at this code sample:

<%@page import="com.softwarefx.chartfx.server.*"%><%--   Document : polygon   Created on : Mar 19, 2008, 12:00:20 PM   Author : Administrator--%><%@page contentType="text/html" pageEncoding="UTF-8"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>   <head>   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">   <title>Annotation: Polygon</title>   </head>   <body>   <%   ChartServer chart1 = new ChartServer(application,request,response);chart1.importChart(FileFormat.XML, application.getRealPath("/") + "/data/samples.cfx");com.softwarefx.chartfx.server.annotation.Annotations annot = new com.softwarefx.chartfx.server.annotation.Annotations();   chart1.getExtensions().add(annot);     com.softwarefx.chartfx.server.annotation.AnnotationPolygon poly = new com.softwarefx.chartfx.server.annotation.AnnotationPolygon();     annot.getList().add(poly);   java.awt.Point[] p = new java.awt.Point[4];   p[0] = new java.awt.Point(250,50);   p[1] = new java.awt.Point(320,150);   p[2] = new java.awt.Point(300,250);   p[3] = new java.awt.Point(200,100);   poly.setColor(java.awt.Color.red);poly.setVertices(p);poly.setClosed(true);   chart1.setWidth(600);   chart1.setHeight(400);   chart1.renderControl();     %>   </body></html> 

Share this post


Link to post
Share on other sites

 Are there any examples allowing the user to modify or edit (or even show the toolbar)?  I can't seem to get it to work (the below code doesn't allow the user to show the toolbar or modify the text annotation):

  annotation.Annotations annots;    annots = new annotation.Annotations();    chart1.getExtensions().add(annots);    annotation.AnnotationText text;    text = new annotation.AnnotationText();    text.setText("This is an Annotation Text2");    text.setTop(120);    text.setLeft(100);    text.setAllowModify(true);    annots.getList().add(((annotation.AnnotationObject)text));    annots.setEnableUI(true); annots.getToolBar();

Share this post


Link to post
Share on other sites

Hi,

You should try to use annot.getToolBar().setVisible(true); instead of annots.getToolBar(); only. However Im checking right now this because I think there is an issue related. I will be osting more information soon. Sorry for the delay.

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
Reply to this topic...

×   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...