Drawing On Chart But It's Disappearing

I created a column chart and added an annotation element to it:
[code]
<mx:annotationElements>
        <mx:CartesianDataCanvas id="chartCanvas"/>
</mx:annotationElements>
[/code]
I added a creation complete method to draw on the canvas. The following function is called on creationComplete.
[code]  
protected function drawSteps():void
       trace("chartCanvas.width is: " + chartCanvas.width);
      chartCanvas.graphics.lineStyle(1, 0x000000, 0.5);
      chartCanvas.graphics.beginFill(0xd4e3f0, 0.5);
      chartCanvas.graphics.moveTo(chartCanvas.width/2, yAxisMax);
      chartCanvas.graphics.lineTo(chartCanvas.width/2, 0);
      chartCanvas.graphics.endFill();
[/code]
This works fine when the chart first loads but if I update the chart series the line goes away. I have added a call to the 'drawSteps()' function in my method that updates the chart series as well but it didn't work. I don't understand why changing the chart series would cause this to stop displaying though, especially considering I call it again when the series is changed. Can anyone help?

Other things may be drawn into the graphics object, and those things might clear what is there first.  It might be better to draw by overriding updateDisplayList()

Similar Messages

  • Can't seem to draw a chart (line chart) using dates rather than numbers

    I'm trying to draw a Line Chart but rather using numbers i want to use dates for example: Switzerland 23/06/2008 - 23/08/2008. Can't seem to get it to work? it seems to all go wrong when I change the cell format to 'date'
    Can anyone help?
    Thanks
    PS. I can do it easily in Excel

    Hello
    From my point of view, it's not surprising.
    In XL, a date is a number to which a date format is applied. So, it may be charted.
    Same thing with the good old AppleWorks.
    With Numbers, a date is NOT a number, it IS a specific class of data.
    The consequence is that it can't be charted directly.
    Happily, we may easily convert a date into a number.
    In column B the formula is
    =A-$A$1
    which calculates the numeric difference between stored dates and the date stored in A1.
    So, we may chart the results.
    I know that it's far from perfect but we have to live with the choices made by Numbers's designers.
    Yvan KOENIG (from FRANCE vendredi 18 avril 2008 18:44:14)

  • On Pie chart rotation - the labels disappear

    I am using followig to rotate a pie chart:
    <mx:Rotate id="rotate" angleFrom="{angle-90}"
    angleTo="{angle}"
    target="{myChart}"/>
    private function rotateImage():void {
    rotate.end();
    angle += 90;
    rotate.play();
    <mx:PieChart id="myChart" dragEnabled="true"
    dragComplete="rotateImage()">
    So, when a user tries to drag the pie chart, the chart
    rotates. The
    chart rotates fine but the labels disappear? why would this
    happen and
    any solution to this.
    Also, I would like to use some other event for rotation
    instead of
    dragComplet. I would like to do it when user clicks left
    mouse
    button+moves the mouse (both on the outside of the chart)
    Any suggetions?
    Thanks in advance.

    Are your fonts embedded? Rotating non-embedded fonts makes
    text disappear during rotation.

  • Drawing pie chart in applet

    Hi,
    The following is an applet I've written as an assignment in school. The applet runs well on appletviewer (here I mean drawing the pie chart). But when I run it on my browser, the pie chart is not drawn. Hope you can help me. Thanks in advance.
    import java.applet.*;import java.text.*;import java.awt.*;import java.awt.event.*;import java.awt.Graphics;public class x2 extends Applet implements ActionListener {               private Button draw,reset;        private TextField thigh,tmedium,tlow,tno;     private Label banner,l1, l2, l3, l4;     double rhigh,rmedium,rlow,rno;     double high, medium, low, no, total, high2=0, medium2=0, low2=0, no2=0,low3, no3;     String something="";          public void paint(Graphics g){     setBackground(Color.white);               if(something=="in"){     try {               rhigh=Double.parseDouble(thigh.getText());     rmedium=Double.parseDouble(tmedium.getText());     rlow=Double.parseDouble(tlow.getText());     rno=Double.parseDouble(tno.getText());     } catch (NumberFormatException nfe) {     }     total=rhigh+rmedium+rlow+rno; high=(rhigh/total)*100; medium=(rmedium/total)*100; low=(rlow/total)*100; no=(rno/total)*100; high2=high*360/100;     medium2=medium*360/100;     low2=low*360/100;     no2=no*360/100;          low3=high2+medium2;     no3=low3+low2;               g.setColor(Color.red);     g.fillArc(100,100,200,200,0,(int)high2);     g.setColor(Color.blue);     g.fillArc(100,100,200,200,(int)high2,(int)medium2);     g.setColor(Color.green);     g.fillArc(100,100,200,200,(int)low3,(int)low2);     g.setColor(Color.pink);     g.fillArc(100,100,200,200,(int)no3,(int)no2);     }     }          public void init(){          draw=new Button("Draw pie chart");     reset=new Button("Reset");     thigh=new TextField("",10);     tmedium=new TextField("",10);     tlow=new TextField("",10);     tno=new TextField("",10);     l1=new Label("High Risk  :$");     l2=new Label("Medium Risk:$");     l3=new Label("Low Risk   :$");     l4=new Label("No Risk    :$");     banner=new Label("Welcome");           add(banner);           add(l1);     add(thigh);          add(l2);     add(tmedium);     add(l3);     add(tlow);     add(l4);     add(tno);                         add(draw);     add(reset);                   draw.setActionCommand("Draw");     draw.addActionListener(this);        reset.setActionCommand("Reset");     reset.addActionListener(this);     }          public void actionPerformed(ActionEvent e){          if(e.getActionCommand() == "Draw") {               something="in";               repaint();                    } else if(e.getActionCommand()== "Reset") {               something="";               thigh.setText("");               tmedium.setText("");               tlow.setText("");               tno.setText("");               repaint();          }     }}

    <code>
    import java.applet.*;
    import java.text.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.Graphics;
    public class x2 extends Applet implements ActionListener {
         private Button draw, reset;
         private TextField thigh, tmedium, tlow, tno;
         private Label banner, l1, l2, l3, l4;
         double rhigh,rmedium,rlow,rno;
         double high, medium, low, no, total, high2=0, medium2=0, low2=0, no2=0,low3, no3;
         String something="";
         public void paint(Graphics g) {
              setBackground(Color.white);
              if(something=="in"){
                   try {
                        rhigh=Double.parseDouble(thigh.getText());
                        rmedium=Double.parseDouble(tmedium.getText());
                        rlow=Double.parseDouble(tlow.getText());
                        rno=Double.parseDouble(tno.getText());
                   catch (NumberFormatException nfe) { }
                   total=rhigh+rmedium+rlow+rno; high=(rhigh/total)*100;
                   medium=(rmedium/total)*100;
                   low=(rlow/total)*100;
                   no=(rno/total)*100;
                   high2=high*360/100;
                   medium2=medium*360/100;
                   low2=low*360/100;
                   no2=no*360/100;
                   low3=high2+medium2;
                   no3=low3+low2;
                   g.setColor(Color.red);
                   g.fillArc(100,100,200,200,0,(int)high2);
                   g.setColor(Color.blue);
                   g.fillArc(100,100,200,200,(int)high2,(int)medium2);
                   g.setColor(Color.green);
                   g.fillArc(100,100,200,200,(int)low3,(int)low2);
                   g.setColor(Color.pink);
                   g.fillArc(100,100,200,200,(int)no3,(int)no2);
         public void init(){
              draw=new Button("Draw pie chart");
              reset=new Button("Reset");
              thigh=new TextField("",10);
              tmedium=new TextField("",10);
              tlow=new TextField("",10);
              tno=new TextField("",10);
              l1=new Label("High Risk :$");
              l2=new Label("Medium Risk:$");
              l3=new Label("Low Risk :$");
              l4=new Label("No Risk :$");
              banner=new Label("Welcome");
              add(banner);
              add(l1);
              add(thigh);
              add(l2);
              add(tmedium);
              add(l3);
              add(tlow);
              add(l4);
              add(tno);
              add(draw);
              add(reset);
              draw.setActionCommand("Draw");
              draw.addActionListener(this);
              reset.setActionCommand("Reset");
              reset.addActionListener(this);
         public void actionPerformed(ActionEvent e) {
              if(e.getActionCommand() == "Draw") {
                   something="in";
                   repaint();
              } else if(e.getActionCommand()== "Reset") {
                   something="";
                   thigh.setText("");
                   tmedium.setText("");
                   tlow.setText("");
                   tno.setText("");
                   repaint();
    </code>

  • I wanna draw line chart

    hi, i wanna draw line chart for some analysis of an image.
    how can i do that?? plz help me in that, code would be more
    better.thank u.

    Yes, you can use the code for free and you can include it in your application for free. JFreeChart is and will always be free software.
    What's not free is the JFreeChart Developer Guide (a 300 page Acrobat PDF document) and access to the JFreeChart Priority Support Forum. You have to pay for these, if you want them, the idea being that a well-funded project will progress faster than one that relies solely on volunteers.
    I get some criticism for taking this "commercial" approach, but I am 100% certain that it has made JFreeChart a better product, so I don't care...
    Regards,
    Dave Gilbert
    JFreeChart Project Leader

  • Openoffice spreadsheet draw combination charts  programatically

    hi all,
    we need to develop a project that is an extension in OO so that it could display a mutitype chart we have drawn in Excel.
    Essentially, we have a combination chart consists of a candle stick chart and a line chart appearing together. OO could not display it!
    (see http://qa.openoffice.org/issues/show_bug.cgi?id=27363).
    We have research the problem for a while and figure that the easiest way is to develop an extension in Java using the Netbean Integration tool. Probably, adding a new chart type so that it is matched to the excel version. In chart2, it appears that they have changed the structure to a MVC model and under the diagram service, a coordinate system could have a list of charttype. So it appears that it is possible to draw a chart with different charttype on it even without the extension. However, we have not tried the chart2 API as we can't find a working example and SUN is not very helpful either and they discourage us to use chart2.
    (see http://graphics.openoffice.org/chart/chart2codestructure.html)
    can you give us advise how to approach this problem ?
    documentation resources , code snippets to call chart2 api from java code and any other helpful suggestion will be very welcomed.
    thanks.

    ok let me put it simply :
    com:sun:star:chart2 is not written in java, it is all written in C++ with those horrible IDL files which I don�t want to know about.
    However, i do think UNO make it possible to be used in a java environment.
    i searched the OOo website and also the web for an example snippet of a java program that calls com:sun:star:chart2 ; but i didn't found anything.
    it would be great if SUN engineers in this forum show me an example of how to use the OOo chart2 API in a java program.
    thanks.

  • How to draw flow chart?

    Anybody knows if Java support drawing flow chart,such as visio and rose software? If Java can do it,please give some examples.
    Thanks

    I know there are libraries out there for editing Word and Excell documents in java, but I'm not sure about Visio. Have you tried google?

  • I have a Macbook Pro (2009) and the tool bar in Safari keeps disappearing. There's a small diagonal arrow on the upper right that I can click and the bar will appear temporarily, but then it disappears from view. "Hide Toolbar" is greyed out in VIEW

    My 2009 Macbook Pro's Safari doesn't show the tool bar anymore.  I can click on a diagonal arrow in the upper right corner that appears when I put my cursor there and the tool bar will show, but then it disappears again.  Also, when I get an email and click on an internet link the Safari doesn't open full page like it used to - it opens as a small little box and I have to click the diagonal arrow in upper right corner for it to open full screen.  Any ideas how to correct this - it is so annoying.  Thanks for any help!

    The "restore disk" is built into the Mac. See About Recovery.
    Need more specifics about what error messages you got while installing Adobe Flash.
    However, you can almost avoid Flash altogether by setting YouTube to play the HTML5 version instead.
    Click the Try something new! link at the bottom of the YouTube page.
    I don't know about the sound issue. Might be hardware as you think. Try other headphones to check.

  • I rented a movie on my iPad. It began to download but then it disappeared. The movie appears in my rented videos, but when I click it, it says, "video rented but not downloaded. Go to downloads to manage downloads". Where did my downloads go?

    I rented a movie on my iPad. It began to download but then it disappeared. I freed up a ton of storage space to make sure I had the room for it. The movie appears in my rented videos, but when I click it, it says, "video rented but not downloaded. Go to downloads to manage downloads". Where did my downloads go? I re-booted my iPad, signed off/on iTunes etc. I can't find a folder with downloadable items anywhere. ITunes just tells me, "you've already rented this video. Do you want to rent it again?" What happened to my movie?

    Did you check the Videos app?

  • Display Month verbiage on chart but sort by month number

    Hello,
    I have inserted a simple bar chart (values by month for a single year) and my goal is to get the data values to group by month.
    I found that I can achieve this by using a formula that extracts the month from my Date/TIme field MONTH({Command.OB_DELIVERY_DATE}).
    This works OK and displays months as 1, 2, 3,  etc. on my chart), but I want to display the month text instead (Jan, Feb, Mar)
    I tried a second variable:  ToText({Command.OB_DELIVERY_DATE},'MMMM')
    This works in displaying the verbiage of the months, however, the problem is that it groups the months on my chart alphabetically now (April is now my 1st month instead of January).
    What is the trick to displaying month verbiage on my chart, but still sorting these months in their proper numerical order?
    Many Thanks!

    Hi Dave,
    Try this please:
    1) Insert a Crosstab and place it on the Report Header. Use the Delivery Date field as the row and add the measure field as the Summary Field with the right Sum function
    2) Highlight the Delivery Date field > Group Options > set it to print 'For Each Mointh'
    3) While in the Crosstab Expert highlight the Delivery Date field > Click Group Options > Options  tab > check the option 'Customize Group Name field' > Select 'use formula as group name' and click the formula button beside. Use this code:
    ToText({Command.OB_DELIVERY_DATE},'MMMM')
    4) Right-click the Crosstab and select Insert Chart. Choose the right Chart Type
    5) Suppress the Section that holds the Crosstab
    Hope this helps.
    -Abhilash

  • Created PDF form in Acrobat XI Pro, but HELP fields disappear when I save FCDT file to PDF. Please help. Thanks!

    Created PDF form in Acrobat XI Pro, but HELP fields disappear when I save FCDT file to PDF. Please help. Thanks!

    I am not aware of a field type "Help" within a PDF form. I do not see it as a form field that can be added in the form edit mode.
    Forms Central forms do not support all the features of Acrobat forms.
    Are you talking about the "Tool Tips" or a hidden field that only shows when one enters a field and is hidden upon exiting the field.

  • Itunes lib show app, but won't install to iPhone I upgraded fro iphone4 to iphone5. i restored from backup in iCloud, and almost everything is there perfectly. there was one app on the phone, which i clicked on to finish the install, but it then disappear

    I upgraded fro iphone4 to iphone5. i restored from backup in iCloud, and almost everything is there perfectly. there was one app on the phone, which i clicked on to finish the install, but it then disappeared. in my iTunes, under library/apps, this app still shows there. how do i reinstall this app. it was a paid app, and i searched the app store, and apparently it is no longer there.
    any help would be greatly appreciated.

    It appears to be fixed, he had multiple versions of iTunes installed (since he put his iTunes in a different folder) the iTunes icon launched the old iTunes, even though the new was installed. it's working now.

  • Is there any way to link the individual rows of data to the corresponding bars in a bar chart so that each legend title appears simultaneously with its corresponding bar when creating a build? I can do it in a pie chart but can't in a bar chart.

    Is there any way to link the individual rows of data to the corresponding bars in a bar chart so that each legend title appears simultaneously with its corresponding bar when creating a build? I can do it in a pie chart but can't in a bar chart.

    You used the data.  Verizon can not see what it was sued for.  However your phone can see whats apps used the data.  go to settings-data usage- there will be a place that says data usage cycle.  line the dates up with your cycle.  then there will be a bar graph below that   extend bother white bars one all the way to the left and one all the way to the right.  after those are extended below that will be a list of apps,  there should be one that used over 2 gb and that will show you what app used that data in her purse

  • How do you close the stock chart but not the stock widget ?

    I have clicked on a stock and get the stock chart but now I don't want the chart, just the stock price widget.
    The prices were originally there without the chart and that's the way I would like it.
    Thanks for any advice.
    iMac Mountain Lion-Dashboard

    Hi, Thanks for the quick reply !
    No, sorry to say, cycling through those 3 dots does not close the chart.
    If I have to, I guess I can delete and then reinstall the widget.
    Seems like there must be a way to close the chart only....

  • TS2621 I receive emails on my Iphone while Outlook is open on my computer but they quickly disappear.  Can this be solved?

    I receive emails on my Iphone while Outlook is open on my computer but they quickly disappear.  Can this be solved?

    No. You really can't do that. Not easily at any rate. You would have to set them both up to use POP3, but even then there is no way to guarantee that the phone won't poll the server prior to your computer doing so, pulling down the message from the server.

Maybe you are looking for

  • Export to text from CR viewer

    Hi all, I need to export my report to the plain text. This option is available in designer (2008), but it is not in the viewer. Any idea how to export the report to txt from the viewer?

  • Error while installing Database 10g on Linux Enterprise 5

    Hi All, When I tried to install Database 10g this error apears All installer requirements met. Preparing to launch Oracle Universal Installer from /tmp/OraInstall2009-02-05_12-55-24PM. Please wait ...bash-3.2$ Exception in thread "main" java.lang.Uns

  • How do I get the coordinates of the text block (TextFrame) help me please!

    Dim myApp As New Illustrator.Application Dim myDoc As Illustrator.Document myDoc = myApp.ActiveDocument Dim textRef = myDoc.TextFrames.Add For Each ArtPageItems In myDoc.PageItems If TypeName(ArtPageItems) = "TextFrame" Then '========It is necessary

  • INTEGER changed to NUMBER(22,0) when table is created in 9i release 2 !!!

    Dears, I have made DB schema for Oracle 9i release 2 on Solaris 5.9, and I was using INTEGER datatype when creating primary key, plz c the following sample script: create table SYSTEM_PARAMETERS ( ID INTEGER not null, NAME VARCHAR2(50) not null, cons

  • ACE 4710 fills up with unexplained 127.0.0.1 SSH sessions

    What could be the cause of such SSH management sessions: ACE/Admin# sh ssh session-info Session ID     Remote Host         Active Time 21763          127.0.0.1   :11034   -347:-22: 9 Such 127.0.0.1 originated SSH sessions are constantly filling the m