Recent

Author Topic: x-axis as cateogies  (Read 2300 times)

daveinhull

  • Sr. Member
  • ****
  • Posts: 297
  • 1 divided by nothing must still be 1!
x-axis as cateogies
« on: March 05, 2019, 08:40:32 am »
Hi,

I'm struggling to get a graph with categories as the x-axis and counts as the y-axis from an access database.
I've got it setup and have managed to get data displayed in a bar chart, but I just cannot get it to display the category names under the x-axis.
When I select the x-axis field to be the name, it just crashes saying that 'xxxxx' is not a floating point?

Any pointers would be great.

Thanks
Dave
Version #:1.8.4 Date 2019-01-08 FPC Version: 3.0.4 and SVN Revision 57972 for x86_64-win64-win32/win64

daveinhull

  • Sr. Member
  • ****
  • Posts: 297
  • 1 divided by nothing must still be 1!
Re: x-axis as categories
« Reply #1 on: March 05, 2019, 10:49:59 am »
Hi,

Ok so it looks as if the x-axis has to be a number, and for my purposes it just needs to be a sequential number. So I've created a filed in my datasource with just a sequence in it, then used the category field as the labelfield. That works, but it would be great if the x-axis could default to just a sequential number, unless of course it can, but I've just missed it.
Version #:1.8.4 Date 2019-01-08 FPC Version: 3.0.4 and SVN Revision 57972 for x86_64-win64-win32/win64

wp

  • Hero Member
  • *****
  • Posts: 11833
Re: x-axis as cateogies
« Reply #2 on: March 05, 2019, 10:52:16 am »
The x field must always be numeric (or empty to get a sequential value). Get the categories names from the text field. Look at attached demo which is a modification of the code which I posted for your other question.

daveinhull

  • Sr. Member
  • ****
  • Posts: 297
  • 1 divided by nothing must still be 1!
Re: x-axis as cateogies
« Reply #3 on: March 05, 2019, 01:26:36 pm »
Thanks wp,

As I mentioned, I worked it out and I went back and removed the dummy sequence field from the x-axis entry and it works fine.

Thanks again
Version #:1.8.4 Date 2019-01-08 FPC Version: 3.0.4 and SVN Revision 57972 for x86_64-win64-win32/win64

 

TinyPortal © 2005-2018