Forum Academy Marketplace Showcase Pricing Features

Bubble chart from list field

I am stuck!

I thought this would be simple but I cant find a plugin that support it.

I have a field which is populated by a list of numbers: 28.0,28.4,28.9,27.4 etc…

I want this field to be the data points for a line graph

is this possible with chart.js or another chart solution in bubble?

All of the tutorials on youtube refer to fields with single values in them

1 Like

In my experience Chart plugins usually require similar arrays of numbers.
Are the numbers coming in a string form?

yes they are from an api call. see example.

Oh, then it’s one of 2 possilibities:

  1. Either it’s a list of strings
  2. Or it’s a single string with comma-separated numbers

In case 1 you can simply run :each item converted to number to extract the list of numbers

In case 2 you can first convert it to a list of strings and then a list of numbers by running
:split by ' , ' : each item converted to number
This first splits the string by the comma ( , ) character and then converts the resulting list of text into a list of numbers.

I have a hunch that one of these might work!

i appreciate your time trying to get this to work.

when i select the correct field from the api call or alternatively from the saved data in the database. I hover over the result (which is coloured blue) and it says evaluates to a list of numbers.

the options available to continue the expression are :formatted as a number (this turns the result red)

or if i try to type in the second option it doesn’t save. There isn’t an option for :split by so i cant build the expression by selecting this from options presented.

which plugin are you working with?

maybe you could try to test with a list of numbers your end and see?

Just a list of numbers should actually work.
: formatted as text would actually make it of type text which is not valid.

Bubble’s chart plugin as well as the Chartjs plugin require a similar list of numbers

looks like there is more than one chart js

this chart js plugin works perfectly out of the box with a list of coma separated numbers. its very powerful and easy to use.

thaks for your input as always we get there in the end. :slight_smile:

1 Like

Yes, at the core though they all use the same library, so I’d expect them to work similarly.

Glad you got it to work!