I have placed a chart on a form. The form is based on a set: Consultants=Consultordcpo
The chart data is based on a 'Custom' xBasic chart definition...
I placed a watch expression in the chart dialog Consultants->Consultnum (a field in the primary table).
The msg_box indicates that a[].value is not being populated correctly... all 0s even though there is data in the table.
of course... When the chart is displayed it is blank... just a blank rectangle where the chart should be.
How can I fix this?
The chart data is based on a 'Custom' xBasic chart definition...
Code:
'Date Created: 30-May-2013 09:11:28 AM 'Last Updated: 25-Jan-2015 01:14:38 PM 'Created By : SMathews 'Updated By : David function plotArrayDataCPOWk as Charting::ChartDataDefinition(ConsultNumber as n) 'For more examples on how to generate a ChartDataDefinition object for different chart types 'see examples in the Learning Xdialog Database ' 'Create an array with some data to plot dim Counter As N dim Count As N dim i As N dim DateTxt1 As C dim DateTxt2 As C dim a[20] As P for Counter = 1 to 20 DateTxt1 = dtoc(date()-(7*Counter)) DateTxt2 = dtoc(date()-(7*(Counter-1))) a[Counter].name = "-" + alltrim(str(Counter)) a[Counter].value = tablesum("consultordcpo","Consultnum = " + alltrim(str(ConsultNumber)) + ".and.BETWEEN(OrderDToProc,{" + DateTxt1 + "},{" + DateTxt2 + "})", "Consultcpo") ui_msg_box("a[Counter].Name = " + a[Counter].name + "a[Counter].value = " + alltrim(str(a[Counter].value)), "a[Counter].Name = " + a[Counter].name + "a[Counter].value = "+ alltrim(str(a[Counter].value)),UI_INFORMATION_SYMBOL+UI_OK) next 'Count = a.size() Count = 20 dim i as n ' Dim the chart & series dim cd as Charting::ChartDataDefinition dim cs as Charting::ChartSeriesDefinition cd.series.add(cs) for i = 1 to Count dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition() cdd.value = format_data(a[i].value,",") cdd.label = a[i].name + " ("+cdd.value+")" cs.data.add(cdd) next plotArrayData = cd end function
The msg_box indicates that a[].value is not being populated correctly... all 0s even though there is data in the table.
of course... When the chart is displayed it is blank... just a blank rectangle where the chart should be.
How can I fix this?
Comment