I am having problems getting a chart to show on my webform. My question is at the bottom. Here are the elements
form.jpg
I am using the chart pack for V11 and trying to chart the last 10 records for, in this example, particle counts.
I have set up a table where I can place the data as we record it (It also includes other data) and associate the particle count to a specific operation that was checked.
This screen shot shows the dialog structure
dialog layout.jpg
The chart set up is
chart screen.jpg
The data series set up is
DataSeriesBuilder.jpgcseries.jpg
When the Submit button is clicked the following excerpt from the javascript is called.
{Dialog.Object}.ajaxCallback('G','','GetData','','');
the xbasic is
function GetData as c (e as p)
dim filter as c
dim order as c
dim what as c = e.dataSubmitted.WhatChecked
dim count as n
dim a_tbl as P
dim num_rec as n = 0
dim count as n
dim txt as c = "" 'clears the value setting
'--The folling runs the filter and tests for number of records. I am graphing the last 10 data points so anything less needs to adjust the data count.
a_tbl = table.open("[PathAlias.ADB_Path]\particles_metals.dbf")
query.filter = "WhatChecked = "+quote(what)
query.order = ""
qry = a_tbl.query_create()
a_tbl.fetch_first()
num_rec = qry.records_get()
if num_rec <11 then
count = num_rec 'sets count to actural number of records is less then 11
else
count = 10 'sets count to 10
end if
'--The following finds the tenth from last record as a start point.
a_tbl.fetch_last()
for i = 1 to 9
a_tbl.fetch_prev(i)
next i
'--Steps through the last 10 records and creates a txt filed with the data array
dim s as n = 1
for s = 1 to count
dim ddate as d = a_tbl.Date 'sets ddate to date of current record
dim part as c = a_tbl.Particle_Diff 'sets part to the particle count of the current record
txt = txt + ddate+"|"+part+crlf() 'builds the array
a_tbl.fetch_next()
next s
a_tbl.close()
getData = txt 'sets the getData variable for charting
end function
??? My debug shows the txt function is building the array like
05/01/2013|23
05/04/2013|45
05/10/2013|33
05/17/2013|65
the getData string looks like
05/16/2013|211 �05/16/2013|311 �05/16/2013|100 �05/16/2013|-23 �05/21/2013|420 �05/21/2013|11 �05/21/2013|201 �05/21/2013|200 �05/21/2013|320 �05/21/2013|200 �
The problem is the chart is not drawing at all. no graph, no data.
Any help is greatly appreciated.
Steve
form.jpg
I am using the chart pack for V11 and trying to chart the last 10 records for, in this example, particle counts.
I have set up a table where I can place the data as we record it (It also includes other data) and associate the particle count to a specific operation that was checked.
This screen shot shows the dialog structure
dialog layout.jpg
The chart set up is
chart screen.jpg
The data series set up is
DataSeriesBuilder.jpgcseries.jpg
When the Submit button is clicked the following excerpt from the javascript is called.
{Dialog.Object}.ajaxCallback('G','','GetData','','');
the xbasic is
function GetData as c (e as p)
dim filter as c
dim order as c
dim what as c = e.dataSubmitted.WhatChecked
dim count as n
dim a_tbl as P
dim num_rec as n = 0
dim count as n
dim txt as c = "" 'clears the value setting
'--The folling runs the filter and tests for number of records. I am graphing the last 10 data points so anything less needs to adjust the data count.
a_tbl = table.open("[PathAlias.ADB_Path]\particles_metals.dbf")
query.filter = "WhatChecked = "+quote(what)
query.order = ""
qry = a_tbl.query_create()
a_tbl.fetch_first()
num_rec = qry.records_get()
if num_rec <11 then
count = num_rec 'sets count to actural number of records is less then 11
else
count = 10 'sets count to 10
end if
'--The following finds the tenth from last record as a start point.
a_tbl.fetch_last()
for i = 1 to 9
a_tbl.fetch_prev(i)
next i
'--Steps through the last 10 records and creates a txt filed with the data array
dim s as n = 1
for s = 1 to count
dim ddate as d = a_tbl.Date 'sets ddate to date of current record
dim part as c = a_tbl.Particle_Diff 'sets part to the particle count of the current record
txt = txt + ddate+"|"+part+crlf() 'builds the array
a_tbl.fetch_next()
next s
a_tbl.close()
getData = txt 'sets the getData variable for charting
end function
??? My debug shows the txt function is building the array like
05/01/2013|23
05/04/2013|45
05/10/2013|33
05/17/2013|65
the getData string looks like
05/16/2013|211 �05/16/2013|311 �05/16/2013|100 �05/16/2013|-23 �05/21/2013|420 �05/21/2013|11 �05/21/2013|201 �05/21/2013|200 �05/21/2013|320 �05/21/2013|200 �
The problem is the chart is not drawing at all. no graph, no data.
Any help is greatly appreciated.
Steve
Comment