Disappearing lines

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
SetOnHi
Newbie
Newbie
Posts: 8
Joined: Tue Jun 18, 2013 12:00 am

Disappearing lines

Post by SetOnHi » Wed Jun 19, 2013 5:08 pm

I am trying to draw 4 lines (one horizontal and 3 making a triangle) on the ScrollPagerDemo (see attached)
but after been drawn they just disappear
If I put the code in a 10000 iteration loop I can see the lines so I assume the code to draw is correct but why do the lines just disappear after the click handler exits

Also the when the lines are drawn they do not consistently appear where one would expect. The bottom fast scroll seems to mess up the location of the x,y coordinates for the lines

The lines are draw with a left or right click on the chart
Attachments
New jZip archive file.zip
(5.02 KiB) Downloaded 954 times

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Disappearing lines

Post by Yeray » Tue Jun 25, 2013 2:04 pm

Hello,

I haven't been able to import the project you've attached; it seems incomplete.
Anyway, looking at the code I see you are using custom drawing techniques at the chart's mouseClicked event. Note the recommended place to use these custom drawing techniques is in the chartPainted event.
I also see you call chart1.repaint() after the drawing operations. Note as it is, this would redraw the chart without your custom drawings.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply