ChartMaker extension

Hi,

I trying to do a simple graph using the Chartmaker extension, but something is wrong :frowning: as I get the following message:

I get some data (temperature and humidity) from a DHT11 through a BLE: It is sent with a ";" separator that allow me to split it in two (first I remove the [ and ]). I manage to display the values in some label zone (label7 and label8) and event do some mathematics in it.
For now I m just looking to X-plot the 2 values (yes it is stupid ... -> the plan is to add an time ID value latter and to append the just received list to the old one to get more than 1 couple of value and have a small historic )

here the part where all is setup:

I m pretty sure it is a stupid thing (I hope so!), but cannot figure out.
here a topic that helped me a bit
(https://groups.google.com/g/mitappinventortest/c/S3tw7gSGE8A/m/D8DFWJQrBAAJ?pli=1)

by advance thx for your help!

1 Like

Assuming that everything works OK up to the point you introduce the Chartmaker block.....

What does your global BT_received_data look like ?

It should be a 2D array / list of pairs e.g.

1,37
2,45
3,41
4,38
5,43
1 Like

.. maybe when I m splitting the list it is creating 1 column with 2 rows? (while I m rather expecting 2 column with 1 row?)

Hi Timai2,
thx for your reply,
At the beginning of the process it got something like [24;65], and after bracket removal and split I guess it is more likely to look like this?... (but I m not sure )
24
65

How to split the text in a way that it is not in row but rather in column? or maybe I do not split, but I replace the ";" by a "," simply?
Sorry, looks surely stupid, but I m not so familiar (yet) with the list ...

Please share an example of your raw stringValues.
( I am surprised it is a list as it is.....)
Your text manipulation probably needs an "\n" in it somewhere

this is how it is send from the arduino : image

the arduino is using a println -> /n

this is how I got it on the app if I just put what I got in a label ["24.00;63.00"]

in the mean time following the row/ column mix up idea I had a try by replacing the ";" by a "," and not doing a split ... but got this error:image

the modified code:

What is in here?:

image

the row data send by the arduino ...if I look at it using the following code
image

I got: ["24.00;63.00"]

OK, this is a list with one item: "24.00;63.00"

Now I am guessing that one of the values is temperature and one is humidity, and that you only want to show the temperature, and that this will only place the one value?

yes it is a list with one item:
how to split it so it will be 2 items but in column like this
24.00(in column A) 63.00 (in column B)
and not in row, all in column A (as the text split is doing)
24.00
63.00

for now I m just trying to Xplot those 2 values (expecting that if I manage to do that I will be able to do it latter with the time in X-ordinate)

This is how you need to present your data to the Chartmaker:

and for several values:

and to chart your two single values:

1 Like

ok, I will try, I guess that is also the method to create a list with 2 columns right?

By the way why there is a 1 there

.... or it is rather creating 3 columns with data set temperature and humidity so the one will be replaced by the hour or any counting index, i m right?

Yes :smiley:

.. maybe I did a mistake but I still get the error: it like if it doens t do the split anymore...

image

here the code I put in (should be similar to yours ... )

If your stringValues is indeed a list:

image

then you won't need to do all that string manipulation, just attach the get stringValues block to each of the select list item blocks in the chartMaker block

image

well doesn't work either
image

run Do It on "is a list thing".....stringValues

yep I tried that is what it give me when I Do it on "is a list thing..."

even when I 'do it' on my original code that is well working (e;g; return the 2 individual temperature/humidity values, each into a label ... ) . below the code that is working without problem:
image