CategoricalData
An Origin C CategoricalData data set is a dynamically allocated and sized array of integers that is tied to an internal Origin data set of type Text. A CategoricalData data set maps the text values in the data to categories referenced by an index (1 based offset). The text value to index map is stored in the CategoricalMap data member. Origin currently supports Ordinal maps in which items are sorted (ordered) alphanumerically. If a non-Text worksheet column in Origin is attached to it will be converted to type Text. When non-Text columns are converted to Text only displayed digits are converted thus precision may be lost if all digits are not displayed in the worksheet. When non-Text columns contain numeric data attaching a CategoricalData data set prompts with a novice dialog box asking the user whether or not to proceed. If the user selects "No" (do not proceed) the conversion to text does not occur and the resulting CategoricalData object is invalid. The CategoricalData class is derived from the Dataset, vector, and vectorbase classes from which it inherits methods and properties.
EX1
void CategoricalData_ex1() { Worksheet wks; wks.Create(); if (wks) { string strWksColname = wks.Columns(0).GetName(); strWksColname = wks.GetPage().GetName() + "_" + strWksColname; StringArray vMyCatMap; CategoricalData cdMyCatData(strWksColname); CategoricalMap cmMyCatMap; cmMyCatMap = cdMyCatData.Map; vMyCatMap = (StringArray) cmMyCatMap; // Reminder Message should select Yes and OK //If no Reminder Messages pops up. Please choose menu Help: Reactivate Reminder Messages } }
origin.h