LineGraph Widget
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
LineGraph Widget
Hello
As a little project I'm building a little Stock app.
For that purpose I employ the LiveCode linegraph widget.
Is there a Way to set the Numberformat of the Y-Axis of the Linegraph? Right now the Y-Axis only displays whole numbers, which for a Stock is pretty useless. I'd like it to Show "#.00" Numberformat.
I'm very thankfull for every help.
Best regards
Zapan
As a little project I'm building a little Stock app.
For that purpose I employ the LiveCode linegraph widget.
Is there a Way to set the Numberformat of the Y-Axis of the Linegraph? Right now the Y-Axis only displays whole numbers, which for a Stock is pretty useless. I'd like it to Show "#.00" Numberformat.
I'm very thankfull for every help.
Best regards
Zapan
Re: LineGraph Widget
Hi Zapan,
1. welcome to the forum!
2. Since this is a widget, I'm afraid this is not possible.
Best
Klaus
1. welcome to the forum!

2. Since this is a widget, I'm afraid this is not possible.
Best
Klaus
Re: LineGraph Widget
Hello Klaus
Thank you very much
I feared as much.
Do you know a function (or maybe have a function laying arroung, I'm sorry for asking this bluntly) that will make a variable that has csv values in it into a nice stock graph, analog the Line graph widget but with the numberformat #.00 on the Y-Axis?
Best Regards
Zapan
Thank you very much

I feared as much.
Do you know a function (or maybe have a function laying arroung, I'm sorry for asking this bluntly) that will make a variable that has csv values in it into a nice stock graph, analog the Line graph widget but with the numberformat #.00 on the Y-Axis?
Best Regards
Zapan
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: LineGraph Widget
Maybe easier to fork the widget source from Github to make the relatively small change you need.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: LineGraph Widget
Hi Zapan,
here is a modded version of the lineGraph widget. It lets you choose the number of decimals to show.
unzip the file and put the folder into folder -> Documents -> myLivecode -> Extensions and restart Livecode.
It will now be installed as a second LineGraph in the tools section, the name is "Line GraphBN"
look at the Properties inspector and the dictionary -> API -> Line GraphBN.
setting the decimalFormat to 0 shows just integers, the default behavior. Setting the decimalFormat to a number greater zero show x decimals.
To uninstall this widget use the -> Tools Menu -> Extension Manager. Or remove the folder from your "Extensions" folder in MyLivecode.
If you do play with this I would be interested how it works for you.
Kind regards
Bernd
Edit: I deleted the version that used to be here and have posted a newer version further down
http://forums.livecode.com/viewtopic.ph ... 15#p145912
here is a modded version of the lineGraph widget. It lets you choose the number of decimals to show.
unzip the file and put the folder into folder -> Documents -> myLivecode -> Extensions and restart Livecode.
It will now be installed as a second LineGraph in the tools section, the name is "Line GraphBN"
look at the Properties inspector and the dictionary -> API -> Line GraphBN.
setting the decimalFormat to 0 shows just integers, the default behavior. Setting the decimalFormat to a number greater zero show x decimals.
To uninstall this widget use the -> Tools Menu -> Extension Manager. Or remove the folder from your "Extensions" folder in MyLivecode.
If you do play with this I would be interested how it works for you.
Kind regards
Bernd
Edit: I deleted the version that used to be here and have posted a newer version further down
http://forums.livecode.com/viewtopic.ph ... 15#p145912
Last edited by bn on Thu Sep 01, 2016 7:43 pm, edited 1 time in total.
Re: LineGraph Widget
Waaaaaaay cool, Bernd, thanks a lot! 

Re: LineGraph Widget
You are welcome, KlausKlaus wrote:Waaaaaaay cool, Bernd, thanks a lot!

What would be a life without decimals?


Kind regards
Bernd
Re: LineGraph Widget
I don't have the slightest idea!bn wrote:What would be a life without decimals?

-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: LineGraph Widget
That's a great enhancement, Bernd. It may be worth considering submitting that as a pull request so it can become part of the master build.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: LineGraph Widget
Hi Richard,
thanks, I am planning to submit this as a pull-request. I just wanted to wait for a little feedback, just in case...
But the code is ready for a pull-request, including inline-documentation and addition to the Properties Inspector.
Adding a property to the Properties Inspector is extremely versatile and easy. Ali Lloyd did a marvelous job with the Properties Inspector and the new IDE.
Kind regards
Bernd
thanks, I am planning to submit this as a pull-request. I just wanted to wait for a little feedback, just in case...
But the code is ready for a pull-request, including inline-documentation and addition to the Properties Inspector.
Adding a property to the Properties Inspector is extremely versatile and easy. Ali Lloyd did a marvelous job with the Properties Inspector and the new IDE.
Kind regards
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: LineGraph Widget
Thanks, Bernd. Your efforts are much appreciated.bn wrote:thanks, I am planning to submit this as a pull-request. I just wanted to wait for a little feedback, just in case...
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: LineGraph Widget
Pull request here:
https://github.com/livecode/livecode/pull/4174
this version compared to the posted version has an additional left margin for Y-labels and limits to maximum of digits for decimals to 5
Kind regards
Bernd
https://github.com/livecode/livecode/pull/4174
this version compared to the posted version has an additional left margin for Y-labels and limits to maximum of digits for decimals to 5
Kind regards
Bernd
Re: LineGraph Widget
Hello Everyone
I'm Sorry for my late reply, lifes busy as it seems...
Thank you very much BN!!! You just made my Life massively easier...! You're a lifesaver.
Works like a charm.
Thanks everyone for your reply and your Help!
Zapan
I'm Sorry for my late reply, lifes busy as it seems...

Thank you very much BN!!! You just made my Life massively easier...! You're a lifesaver.

Works like a charm.
Thanks everyone for your reply and your Help!
Zapan
Re: LineGraph Widget
Hi,
when discussing the pull request
https://github.com/livecode/livecode/pull/4174
it turned out that the Livecode team prefers a more generalized version of the valueToString / numberFormat / decimal problem. That should go into a module that is available to all widgets.
I think that is perfectly reasonable and I closed the pull request.
For those who compiled & installed the LCB script I posted above please note that as of LC 8.1.0 DP2 the widget format changed slightly and widgets compiled with earlier versions need to be recompiled with the newer LC version.
Kind regards
Bernd
when discussing the pull request
https://github.com/livecode/livecode/pull/4174
it turned out that the Livecode team prefers a more generalized version of the valueToString / numberFormat / decimal problem. That should go into a module that is available to all widgets.
I think that is perfectly reasonable and I closed the pull request.
For those who compiled & installed the LCB script I posted above please note that as of LC 8.1.0 DP2 the widget format changed slightly and widgets compiled with earlier versions need to be recompiled with the newer LC version.
Kind regards
Bernd
Re: LineGraph Widget
Hi all,
I 've tried to use the widget Line GraphBN, my LC vers. is 8.0.1
unzipped the file into folder -> Documents -> myLivecode -> Extensions and restarted Livecode, but I can't see the new line graph into the tools palette.
into extentions folder I 've the "com.livecode.widget.lineGraphBN.1.0.2" folder
something wrong?
thanks franco
I 've tried to use the widget Line GraphBN, my LC vers. is 8.0.1
unzipped the file into folder -> Documents -> myLivecode -> Extensions and restarted Livecode, but I can't see the new line graph into the tools palette.
into extentions folder I 've the "com.livecode.widget.lineGraphBN.1.0.2" folder
something wrong?
thanks franco