We have a database table with the following columns:
analog_tag_ID(INT), date_time(DATETIME), and value(FLOAT).
Each entry in the table corresponds to a record of a data sensor at a particular point in time. For example, at "2019-08-10 12:00:00" analog sensor 1 was reading value 50.3. We are able to create a datatable, however when we try to create a multi-line Chart (1 line per sensor) it doesn't sort/filter the process the data correctly. Instead of 9 lines (1 per sensor), we get two lines: analog_tag_ID (with all the sensors combined) and value. Could you please tell us how to fix this? We tried to change the analog_tag_ID data type from INT to String, but the plugin complained that there could only be one datetime/string column in the chart.
MySQL Query:
SELECT analog_tag_ID, date_time, value FROM `analog_event` WHERE date_time between '2019-08-21 13:22:32' and '2019-08-21 14:22:32';
Can you please show me how the table looks like when generated, and also what you're expecting the chart to look like in the end?
When creating charts, you can only add one datetime/string column, that is correct, and cannot be changed, so I'd like to take a look at the table's structure and see what we can do.
Thanks for helping us with this. Currently, the chart looks like "Chart.jpg" (see attachment). In the chart, you'll notice that there are two "serie" in the chart: analog_tag_ID and value (see attachment "Series settings.jpg"). In addition, the DATETIME entries keep repeating, which we don't want. What we want is to have a serie for each value of analog_tag_ID (1-9), plotted on the chart according to it's corresponding value and date_time entries. For example, if you look at the "table data.jpg" attachment (a subset of the data we're using), you'll notice that there are seven entries for each analog_tag_ID, with each entry having a different value and timestamp). So if the table we're using has nine different analog_tag_ID values, we want nine different lines plotted on the chart, with the corresponding date_time and value entries used to draw each line.
Here is an example of what we would like to look like (DESIRED CHART.jpg).
We have a database table with the following columns:
analog_tag_ID(INT), date_time(DATETIME), and value(FLOAT).
Each entry in the table corresponds to a record of a data sensor at a particular point in time. For example, at "2019-08-10 12:00:00" analog sensor 1 was reading value 50.3. We are able to create a datatable, however when we try to create a multi-line Chart (1 line per sensor) it doesn't sort/filter the process the data correctly. Instead of 9 lines (1 per sensor), we get two lines: analog_tag_ID (with all the sensors combined) and value. Could you please tell us how to fix this? We tried to change the analog_tag_ID data type from INT to String, but the plugin complained that there could only be one datetime/string column in the chart.
MySQL Query:
SELECT analog_tag_ID, date_time, value FROM `analog_event`
WHERE date_time between '2019-08-21 13:22:32' and '2019-08-21 14:22:32';
Hello universalgc.
Thank you for your purchase.
Can you please show me how the table looks like when generated, and also what you're expecting the chart to look like in the end?
When creating charts, you can only add one datetime/string column, that is correct, and cannot be changed, so I'd like to take a look at the table's structure and see what we can do.
Best regards.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Aleksandar,
Thanks for helping us with this. Currently, the chart looks like "Chart.jpg" (see attachment). In the chart, you'll notice that there are two "serie" in the chart: analog_tag_ID and value (see attachment "Series settings.jpg"). In addition, the DATETIME entries keep repeating, which we don't want. What we want is to have a serie for each value of analog_tag_ID (1-9), plotted on the chart according to it's corresponding value and date_time entries. For example, if you look at the "table data.jpg" attachment (a subset of the data we're using), you'll notice that there are seven entries for each analog_tag_ID, with each entry having a different value and timestamp). So if the table we're using has nine different analog_tag_ID values, we want nine different lines plotted on the chart, with the corresponding date_time and value entries used to draw each line.
Here is an example of what we would like to look like (DESIRED CHART.jpg).
Hey universalgc
Alright, I see what you mean.
To get the desired result, you need to change the table structure so it looks like this:
So, each tag should have its column, and the data for a specific time and date should be in the same row, as displayed above.
Now, I have only 4 entries, so the curve cannot be seen in the chart yet, but this is how it looks like:
I hope this helps.
Best regards.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Thanks Aleksandar, I'll check to see if this table format will work with our current project.
You're welcome, universalgc.
If you have any further questions or issues, please feel free to open a new ticket, and we'll gladly help.
Best regards.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables