How to put Labels to xy-values

Get help and support using chartsEngine for LiveCode.

Moderators: heatherlaine, BvG

Post Reply
JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 316
Joined: Tue Jul 20, 2010 12:40 pm

How to put Labels to xy-values

Post by JosepM » Mon Sep 16, 2013 1:52 am

Hi,

I would like to know how can I label x and y data. I mean for example put an string or any other value non numeric nor datetime.

Data sample.

10/8 2 3
09/8 1 2
08/8 5 9
07/8 2 3
06/8 8 6

Sun 2 3
Mon 1 2
Thu 5 9
Wed 2 3
Sat 8 6

First col is the day/month, second col is customers and the last one the orders.
If I try to show it the graphics collapse one between others and the graph is unreadable.

Other issue is how can I put a sublabel under the x-axis like "Orders per day and customer"?

Thanks in advance,
Josep M

JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 316
Joined: Tue Jul 20, 2010 12:40 pm

Re: How to put Labels to xy-values

Post by JosepM » Tue Sep 17, 2013 7:15 pm

Hi,

Any help about this? :)

Salut,
Josep M

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5379
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: How to put Labels to xy-values

Post by FourthWorld » Tue Sep 17, 2013 7:43 pm

Writing a charting library is a bit of work - doable, but tedious. I could point you to the "location" property in the Dictionary, and suggest groups, etc., but really for something this tedious I'm happy to let someone else's good work do the heavy lifting for me, like Hugh Senior's ChartMaker.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 316
Joined: Tue Jul 20, 2010 12:40 pm

Re: How to put Labels to xy-values

Post by JosepM » Tue Sep 17, 2013 7:45 pm

:) I go to download the demo... thanks!

Salut,
Josep M

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Re: How to put Labels to xy-values

Post by BvG » Wed Sep 18, 2013 9:54 am

JosepM wrote:I would like to know how can I label x and y data. I mean for example put an string or any other value non numeric nor datetime.
...
If I try to show it the graphics collapse one between others and the graph is unreadable.

Other issue is how can I put a sublabel under the x-axis like "Orders per day and customer"?
Hi Josep

ChartsEngine is not mainly made for flexible labeling. So 'sublables under the x-axis'; you'd have to do that yourself (for example create a field that you position below the charts group).

As for the other question about collapsing graph, you can only enter numerical data into charts["data"]. So for the day/month, you'd need a date in seconds, and then use the charts["XconvertsTo"], for showing it as a readable date.

Please make sure to read the relevant entries in the documentation.
Use an alternative Dictionary viewer:
http://bjoernke.com/bvgdocu/

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 316
Joined: Tue Jul 20, 2010 12:40 pm

Re: How to put Labels to xy-values

Post by JosepM » Wed Sep 18, 2013 10:04 am

Hi BvG,

Thanks for answer. So show any label on X/Y like "Team A,Team B, Team C" isn't possible, isn't?

Salut,
Josep M

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Re: How to put Labels to xy-values

Post by BvG » Wed Sep 18, 2013 10:18 am

Yes that is correct.
Use an alternative Dictionary viewer:
http://bjoernke.com/bvgdocu/

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

FLCo
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 36
Joined: Thu Jul 27, 2006 5:40 am
Location: England
Contact:

Re: How to put Labels to xy-values

Post by FLCo » Wed Sep 18, 2013 7:12 pm

As Richard has mentioned ChartMaker, it supports both x-axis sub-labeling and y-axis sub-labeling, such as "Orders per day and customer" and "Number of orders". The y-axis label can be horizontal or rotated.

Data labeling is automatic, taken from the specified Categories and Values you supply.

To collapse a graph, simply update the chart with a replacement set of values using CMupdateChart. It's built in.


Hope this helps.

Hugh Senior
The Flexible Learning Company
• ChartMaker: www.FlexibleLearning.com/chartmaker
• ControlManager: www.FlexibleLearning.com/controlmanager
• The Scripter's Scrapbook: www.FlexibleLearning.com/ssbk
• DatePicker: www.FlexibleLearning.com/datepicker

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5379
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: How to put Labels to xy-values

Post by FourthWorld » Wed Sep 18, 2013 8:04 pm

BvG and the others here: Please accept my apologies for my misplaced post. While it seems the outcome wasn't bad in terms of finding a solution for a need that ChartsEngine doesn't currently address, it wasn't until now that I realized this discussion is in the forum section dedicated to ChartsEngine.

When I log into the forums I hit the "New Posts" link and click those that look like I may be able to help with. I rarely take the time to note all the other details for each new post beyond the thread title, but it's clear now that I should take more care to note the section the post is in. I'll try to do a better job of that going forward.

Since Hugh's post was in response to mine, I take full responsibility for both posts being off-topic here.

Sorry for the off-topic posts.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Re: How to put Labels to xy-values

Post by BvG » Thu Sep 19, 2013 7:32 pm

All's fine don't sweat it ;-)

We solved the problems by direct emails in the end.
Use an alternative Dictionary viewer:
http://bjoernke.com/bvgdocu/

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Post Reply

Return to “chartsEngine”