ChartClientState Class Properties

In this section, the ChartClientState class properties are presented in alphabetical order.

Description

Use this property to return an array of String representing the data items selected by the user. Each element of the array is in the following format with the first row represented as row 0:

RECORD_NAME.FIELD_NAME.ROW_NUM

This property is read only.

Example

Each element of the aSelections array is in the following format with the first row represented as row 0:

RECORD_NAME.FIELD_NAME.ROW_NUM

You must parse each element of the array to extract the row number returned and then update the appropriate row in the RECORD.FIELD that stores the Y/N values used by the SetSelectedData method of the Chart class whenever the chart is redrawn. Similarly, deselecting a data item must reset the value of that RECORD.FIELD to N.

In the following PeopleCode example, the field name, QE_SELECTED, is hard-coded in the program. For debugging purposes, this program also writes the complete set of selected data items to the QE_CHARTPROP.QE_CHARTSELECTION field:

import PTCHART:ChartClientState;

Local PTCHART:ChartClientState &myObj = create PTCHART:ChartClientState("QE_CHARTPROPWRK", "QE_CHART_FIELD");

rem display selected chart type ;
Local integer &nRet = &myObj.nType;
QE_CHARTPROP.QE_CHARTTYPE = &nRet;

Local array of string &aSelected = &myObj.aSelections;

rem clean the session storage everytime;
QE_CHARTPROP.QE_CHARTSELECTION = "";
Local string &sForm = "win0";
Local string &sR = "QE_CHARTPROPWRK";
Local string &sF = "QE_CHART_FIELD";
Local string &sOc = "0";

AddOnLoadScript("oGlblChrt.RemoveTypeFromStorage('" | &sForm | "','" | &sR | "','" | &sF | "','" | &sOc | "')");
AddOnLoadScript("oGlblChrt.RemoveSelectionFromStorage('" | &sForm | "','" | &sR | "','" | &sF | "','" | &sOc | "')");
rem  end clean;

rem display selected datapoints if any;
rem  when datapoint is not selected;
Local string &stest = ".";
If Find(&stest, &aSelected [1]) = 0 Then
   QE_CHARTPROP.QE_CHARTSELECTION = "No Data Selected!";
   
   rem Also save N in database ;
   Local Rowset &RS;
   &RS = GetLevel0().GetRow(1).GetRowset(Scroll.QE_CHARTPROPS);
   &Allrows = &RS.ActiveRowCount;
   For &i = 1 To &Allrows
      &Rec = &RS.GetRow(&i).GetRecord(Record.QE_CHARTPROPS);
      &Rec.GetField(Field.QE_SELECTED).value = "N";
   End-For;
   rem end save;
   
Else
   rem  when datapoint is selected;
   Local string &sSelected = &aSelected.Join(",  ", "", "");
   
   rem clean the database first;
   &RS = GetLevel0().GetRow(1).GetRowset(Scroll.QE_CHARTPROPS);
   &Allrows = &RS.ActiveRowCount;
   For &i = 1 To &Allrows
      &Rec = &RS.GetRow(&i).GetRecord(Record.QE_CHARTPROPS);
      &Rec.GetField(Field.QE_SELECTED).value = "N";
   End-For;
   rem end clean;
   
   QE_CHARTPROP.QE_CHARTSELECTION = &sSelected;
   rem split it and save to the database as Y;
   For &i = 1 To (&aSelected.Len)
      &aRecFieldRow = Split(&aSelected [&i], ".");
      &recName = LTrim(&aRecFieldRow [1], """");
      &rowNum = RTrim(&aRecFieldRow [3], """");
      &RecField = &recName | "." | "QE_SELECTED";
      UpdateValue(@&RecField, Value(&rowNum + 1), "Y");
   End-For;
   
End-If;

Description

Use this property to specify an Integer representing the row number for the chart.

This property is read-write.

Example

import PTCHART:ChartClientState;

Local PTCHART:ChartClientState &chartState = create PTCHART:ChartClientState("QE_CHARTPROPWRK", "QE_CHART_FIELD");
&chartState.nChartRow = 1;

Description

Use this property to return an Integer representing the new chart type as selected by the user.

The returned Integer values are:

Numeric Value

Description

0

Bar chart.

4

Line chart.

6

Pie chart.

13

Horizontal bar chart

This property is read-only.

Example

import PTCHART:ChartClientState;

Local PTCHART:ChartClientState &myObj = create PTCHART:ChartClientState("QE_CHARTPROPWRK", "QE_CHART_FIELD");
Local integer &nRet = &myObj.nType;
QE_CHARTPROP.QE_CHARTTYPE = &nRet;