[Gambas-user] Trying charts - how to do that?

Dag JNJ gambas at cd-bahia.com
Wed Dec 7 15:52:10 CET 2022



Am 07.12.22 um 02:49 schrieb Jussi Lahtinen:
>
>     /Public Sub Button1_Click()
>
>       Draw.Begin(da1)
>       Draw.Line(15, 15, 20, 20)
>       Draw.End
>
>     End
>     /
>     I get the error-message /Cannot paint outside of Draw handler
>     /
>
>
> You are doing the drawing inside _Click() event, when you need to do 
> it inside _Draw() event.
> OR set the property "cached = true".
>
> Jussi
>
> ----[http://gambaswiki.org/wiki/doc/netiquette  ]----
I set cache to true and changed Draw to Paint

/Public Sub Button1_Click()//
//
//  Paint.Begin(da1)//
/
/  Paint.MoveTo(15, 15)//
//  Paint.LineTo(120, 120)//
//  Paint.End//
//
//End

/This makes no error any more, but makes no line. So I tried/

Public Sub Button1_Click()

   Paint.Begin(da1)
   Paint.Color(Color.Black)
   Paint.MoveTo(15, 15)
   Paint.LineTo(120, 120)
   Paint.End

End
/doesn'r change anything.
It's such a pity I can't get the examples to run, all with DrawingArea 
demand gb.qt4 and gb.qt4.ext.
Anyway, I looked at the project ChartReport from the Software-Farm and 
got confused because it uses an abject Chart which is not defined 
anywhere and I can't see that is a property or method either. And it 
uses Line, I think the previous version uses LineTo, so outdared.
Cost so much time and I am sorry to bother you with this. I need only 
one example which runs, the rest I can figure out.
Regards, Dag
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221207/c976d847/attachment.htm>


More information about the User mailing list