Hello,
Please refer to the example below:
void MyCategoricalMap()
{
Worksheet wks=Project.ActiveLayer();
if (wks)
{
vector<string> vstrKey={"aa", "cc", "bb", "dd"}; //design your own categories map
for(int ii=0;ii<5;ii+=2){
wks.Columns(ii).SetAsCategorical(CMT_NOMINAL); //set column into categorical with normal mode
wks.Columns(ii).GetCategoricalMap().ReplaceMap(vstrKey); //update the categorical map
}
}
}
and the worksheet and graph after execute:
Best regards!
Jason
OriginLab Technical Service