making charts-graphs

anuj0sharma

Member
Licensed User
Longtime User
Hello Experts,
I have an application which periodically calculates few parameters and I want to do this.

1. I want to log this parametric data in some file or database. suggest the simplest one. [may be .dat or .txt as in VB]
2. I want to give a graphical representation to this data.
e.g. say a Time Vs Value chart of parameter1, or
A monthly consumption of power by a source in terms of bar Graph.
3. saving those records to a suitable file format to read it on PC.

How to do 1, 2 and 3?

I am in thinking phase and any type of suggestions/examples/experience are most welcome.

best regards,
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

anuj0sharma

Member
Licensed User
Longtime User
Thanks for the reply Erel.
3. There are many options. You can just copy the database to the PC and open it. Or you can export the data to CSV, or JSON.

3 includes graphics as well. I guess it require to use some graphical file format.

secondly, any specific reason to go for DB then normal file storage.?
do not have much experience of handling data bases. Still look for this option and try to learn.

Erel, will you able to share some example programs for 1,2 and 3.

Regards,

Edit: cant compile this code http://www.b4x.com/forum/basic...-new-post.html

I am getting this error..

Compiling code. Error
Error compiling program.
Error description: Unknown member: getcolumnname
Occurred on line: 269
sb.Append("<th>").Append(c.GetColumnName(i)).Append("</th>")
Word: getcolumnname

Regards,
 
Last edited:
Upvote 0

anuj0sharma

Member
Licensed User
Longtime User
this works when I have modified data in editBoxes...
this gives the below error if the data is same as previous data..

android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed

B4X:
Sub RefreshData
   Dim listOfMaps As List 
   listOfMaps.Initialize
   
   Dim data As Map   
   data.Initialize
   data.Put("Power",edtPower.Text)
   data.Put("Temperature",edtTemp.Text)
   data.Put("Ambient_Light",edtAmbLite.Text)
   data.Put("Illumination",edtIllumin.Text)

   listOfMaps.Add(data)
   DBUtils.InsertMaps(SQL,"luminaire",listOfMaps)
   
   WebView1.LoadHtml(DBUtils.ExecuteHtml(SQL,"SELECT * FROM luminaire",Null,0))   
End Sub


Edit: I guess the reason for the error is coz of duplication of primaryKey..."Power" was also specified as PrimaryKey while creating the table..
changing only power value everytime takes a new entry..please confirm on this.
 
Last edited:
Upvote 0
Top