LineGraph Widget

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: LineGraph Widget

Post by bn » Sun Aug 21, 2016 10:21 pm

Hi Franco,

into extentions folder I 've the "com.livecode.widget.lineGraphBN.1.0.2" folder
just tried with that version and it worked with 8.0.2.
It showed up as a second linegraph widget with the same icons as the original linegraph widget. The tooltip tells you which version is which. You do need to restart Livecode to see the widget after you placed it into the "Exensions" folder.

If however you are using 8.1.0 dp 2 or 3 then the widget format has changed and you would have to recompile the widget.

That is easy to do: put "com.livecode.widget.lineGraphBN.1.0.2" folder for example on your desktop
then open "lineGraphBN2.lcb" from -> "Menu" -> "Extension Builder" and do "Install". Before you could do "Test" to see the widget.

When you do "Install" then you do a restart and you should see a second "lingraph widget" in the tools palette. To get rid of the widget remove it manually from the "Extensions" folder or use the -> "Menu" -> "Extension Manager" to remove it.

If there is any problem with this please ask.

Kind regards

Bernd

francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Re: LineGraph Widget

Post by francof » Mon Aug 22, 2016 6:39 pm

Hi Bernd,
thanks now I 've the second Line Graph into the tool palette amed Line GraphBN.
but I am still without decimals, I've separated them with dot: it is correct?

ciao
franco

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: LineGraph Widget

Post by bn » Mon Aug 22, 2016 7:56 pm

Hi franco,

by default "LineGraphBN" has no decimals. Please use the Properties Inspector to change to more decimals.

You also might have a look at the Dictionary -> API -> LIne GraphBN to see how to set it by script. (look for decimalformat)

Please be aware that due to the current numberToString conversion in Livecode Builder the number of decimals that are displayed depends on the length of the integer part of a real number. That means that the larger the integer part is the shorter is the decimal part. ( http://quality.livecode.com/show_bug.cgi?id=18159 ). The missing decimals are filled with zeros up to the number of desired decimals.

Kind regards
Bernd


these real numbers

0.123457
1.123457
10.123457
100.123457
1000.123457
10000.123457
100000.123457
1000000.123457

turn into

0.123457
1.12346
10.1235
100.123
1000.12
10000.1
100000
1e+06

francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Re: LineGraph Widget

Post by francof » Tue Aug 23, 2016 4:52 pm

Hi Bernd,

I'm such a fool,
into your first post I read:
bn wrote: ...
setting the decimalFormat to 0 shows just integers, the default behavior. Setting the decimalFormat to a number greater zero show x decimals.
...
but I've forgotten it, sorry.

I'm using numbers with 2 integers and 1 decimal. it seems to works great:
graf.JPG
graf.JPG (16.57 KiB) Viewed 9855 times
a question:
is it a normal behavior do not see the true value of the vertical axis (except first and last)? mine are:
18.2
18.9
20
21.5


But I've a bigger problem, unfortunately: when I close LC and restart it, Line GraphBN disappears. I've followed your suggestions:
bn wrote:...
That is easy to do: put "com.livecode.widget.lineGraphBN.1.0.2" folder for example on your desktop
then open "lineGraphBN2.lcb" from -> "Menu" -> "Extension Builder" and do "Install". Before you could do "Test" to see the widget.
...
below a screenshot of the Extention Builder window with a line error (the last one)
extBuilder.jpg
to have again Line GraphBN into the tool palette I've tried the Extention Manager from the Tools menu selecting the .ice file situated into the folder "com.livecode.widget.lineGraphBN.1.0.2"
I must to repeat this again and again because the widget disappears

here the files I've into the extention folder first, and those into the "com.livecode.widget.lineGraphBN.1.0.2" folder
folders.jpg
best
franco

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: LineGraph Widget

Post by bn » Tue Aug 23, 2016 5:12 pm

Hi Franco,
is it a normal behavior do not see the true value of the vertical axis (except first and last)? mine are:
18.2
18.9
20
21.5
this is normal, the widget interpolates the y axis values between the highest and the lowest values.
But I've a bigger problem, unfortunately: when I close LC and restart it, Line GraphBN disappears. I've followed your suggestions:
If you recompile the widget from e.g. the desktop there should be no copy of the widget in the My Livecode -> Extension folder. Just delete the folder in the Extension folder. If you want to keep the icons for the widget you would move them from the "Support" folder in your Extensions version into the folder on your desktop with the .lcb file in it.
Best is to restart Livecode after you deleted the folder in Extension folder, then there is not copy of the old widget in memory ( that is what the error indicates) Livecode only checks at start-up the extension folder and that is it.)

To sum it up: if you want to recompile the widget do as you did but remove the folder from "Extensions". When you choose "Install" from "Extension Builder" it will recreate the folder in "Extensions". Then do a restart and the widget should be in the Toolbar for you to use.

There is still the problem of the new widget format: if you compile using 8.1.0 DP2 or DP3 then it will not work when you open LC version 8.0.1 or 8.0.2 and vice versa.

Kind regards

Bernd

francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Re: LineGraph Widget

Post by francof » Wed Aug 24, 2016 6:04 pm

Hi Bernd,
I done this:
bn wrote:...If you want to keep the icons for the widget you would move them from the "Support" folder in your Extensions version into the folder on your desktop with the .lcb file in it.
Best is to restart Livecode after you deleted the folder in Extension folder, then there is not copy of the old widget in memory ( that is what the error indicates) Livecode only checks at start-up the extension folder and that is it.)...
obviously not on desktop but into the folder where I've put the widget folder downloaded.

I do not know why, but when I open LC the widget sometimes is present into the tools palette, others no.
when not show, and open a file .livecode I got this error:
Cattura.JPG
best regards
franco

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: LineGraph Widget

Post by bn » Wed Aug 24, 2016 7:06 pm

Hi Franco,
I do not know why, but when I open LC the widget sometimes is present into the tools palette, others no.
when not show, and open a file .livecode I got this error
I don't understand what is happening. For me if it works once it works all the time if the version of LC is the right one for the compilation.

What Operating System are you using? Do you always use Livecode 8.0.1? Maybe it is a bug in 8.0.1.

Maybe you should try 8.1.0 DP3. It is much improved over 8.0.1. And the next release will be a release candidate. This means the next "Stable" version will be 8.1.0 anyways.

http://downloads.livecode.com/livecode/

Of course you would have to recompile the widget as described above for 8.1.0 DP2 and up.

Sorry, no more ideas. If you want me to I could recompile the widget for 8.1.0 DP3 and upload it.

Kind regards
Bernd

francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Re: LineGraph Widget

Post by francof » Thu Aug 25, 2016 9:30 am

Hi Bernd,
bn wrote:I don't understand what is happening. For me if it works once it works all the time if the version of LC is the right one for the compilation.
Bernd
for me too should be so :) anyway don't worry, i'm special to find troubles.

I'm using Win 10 Home 64bit, and I get the mentioned issue in LC vers. Indy 8.0.1 (I've oldest vers installed but not using after this one).
bn wrote: Maybe you should try 8.1.0 DP3. It is much improved over 8.0.1. And the next release will be a release candidate. This means the next "Stable" version will be 8.1.0 anyways.
Bernd
ok, I will try the vers. you suggested. is it better to remove the older or is non influential?
and yes, if you want recompile the widget will be great, thanks.

talking of LineGraphBN, there is a way to show the value near the corresponding dot in the line of the graphic? if no someone should think at this.

best regards
franco

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: LineGraph Widget

Post by bn » Thu Aug 25, 2016 9:48 am

Hi Franco,
I will try the vers. you suggested. is it better to remove the older or is non influential?
You can have as many versions of LC on disk and even use them concurrently as you want.

The only problem could arise with the LC preference file if you close an older version after the newer version because some features of the newer version aren not saved when saving the older version last.
and yes, if you want recompile the widget will be great, thanks
the lineGraph widget in LC 8.1.0 DP3 is a little different from the one I modified and I am trying to teach the new one the display of decimals. I am afraid this will take a while.

But I can certainly compile my version for the new widget format for 8.1.0 DP2 and up. For older 8.x.x version the one I posted above should work.
talking of LineGraphBN, there is a way to show the value near the corresponding dot in the line of the graphic? if no someone should think at this.
No, that is not supported in the linegraph widget and that is a tricky thing to do: think of a lot of datapoints and it can easily clutter the graph.

The linegraph widget is a very nice example of what can be done in Livecode builder but is by no means the solution to all diagram needs.

Kind regards
Bernd

francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Re: LineGraph Widget

Post by francof » Thu Aug 25, 2016 10:30 am

Hi Bernd,

ok, I will try with v. 8.1.0 DP3 and I will let you know how is gone.

best regards
franco

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: LineGraph Widget

Post by bn » Thu Aug 25, 2016 7:56 pm

Hi Franco,

just today Livecode released LC 8.1.0 RC1, rather use that version.

Here is a version of the line graph widget modified by me for LC version 8.1.0 DP2 and up. (widget format changed as of that version)

Unzip the file and place the folder into -> Documents -> My Livecode -> Extensions, restart Livecode. Now a widget "Line GraphBN" should be in your Toolbar. To remove the widget remove the folder from your extensions folder.

Please note: this is the modified line graph widget that came with LC versions prior to LC 8.1.0 RC1. In LC 8.1.0 RC1 there is some added functionality for the Livecode Line Graph, but unfortunately no decimal digits.

Kind regards
Bernd

Edit: deleted file. This version was replaced by a newer version a couple of posts down. Please use that version.
Last edited by bn on Tue Aug 30, 2016 11:27 am, edited 1 time in total.

francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Re: LineGraph Widget

Post by francof » Mon Aug 29, 2016 6:15 pm

Hi Bernd,
unfortunately the problem is still on: sometimes the LineGraphBN icon is not shows in the tool palette and, if the widget is already in the file a unknow module error window is show.

I've done those steps:
- downloaded and installed LC 8.1.0 RC1
- downloaded and placed the unzipped folder into -> Documents -> My Livecode -> Extensions
- restarted LC
but I did not have the widget "Line GraphBN" in the toolbar. damn!
to see it, I did have to run the "Extension Builder" from the Tools menu (sometimes)

at this point I think to set aside this widget, sorry. I throw in the towel.
anyway, for my need, it was important to see the real value corresponding to the intermediates dots in the axes.

thanks a lot for your help
ciao
franco

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: LineGraph Widget

Post by bn » Mon Aug 29, 2016 6:29 pm

Hi Franco,

sorry to hear this. What I would do in your case is to throw away the Livecode7 preferences. They at times got corrupted.

Close all instances of Livecode.

You might want to move the stack in folder "User" -> "Library" -> "Preferences" -> "Runrev" -> "livecode7.rev" somewhere else in case you want to restore your old preferences if you have a lot of them set and taking the preferences away does not do what you want. Namely to get a clean and better working Livecode. Or just delete the stack if you have only set a couple of preferences.

Now start Livecode 8.x.x. again.

I just don't know where in Windows the preferences are stored. It must be something similar to the Mac path shown above.

Of course this is just a guess but well worth a try. The error you get is just to strange.

Kind regards

Bernd

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: LineGraph Widget

Post by bn » Mon Aug 29, 2016 11:50 pm

Hi Franco,

how do you like this? Is that what you had in mind?

lineGraph with values.png
Kind regards

Bernd

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: LineGraph Widget

Post by bn » Tue Aug 30, 2016 11:25 am

Hi Franco and all,

here is a modified version of the lineGraph widget 1.1.0 that came with Livecode 8.1.0 DP3

The unmodified version 1.1.0 has the added functionality to show different symbols for vertices, optionally hiding lines (just showing the vertices).

The modified version 1.1.0 adds optional display of decimals up to 5 and the optional display of data values at the vertices plus minor cosmetic tweaks.

Since I discovered a bug in previous versions of the modified line graph the version I post here will replace the previous versions.

You need to run Livecode 8.1.0 RC1 to run this version.

As usual unzip the zip file and put the resulting folder into "My Livecode" -> "Extensions" and restart Livecode.

Kind regards
Bernd
Attachments
com.livecode.widget.lineGraph8.1BN.1.1.0.zip
(35.06 KiB) Downloaded 246 times

Post Reply