PB中动态建立Graph数据窗口时Category和value如何设置
发布网友
发布时间:2022-04-27 00:51
我来回答
共1个回答
热心网友
时间:2022-06-21 23:38
Category说通俗一点就是代表图形的X轴
value就是Y轴
举个例子
月份 销售量
1 100
2 150
3 120
3 140
这时候我们要看图形的话,如果是柱状图,那就是category设置成月份
value设置成销售量
举个例子,拷贝的,你主要更改一下其中的
category='dept_id' values='avg(salary for graph)'这行
category设置成月份,value设置成你要的结果
//STEPS TO DYNAMICALLY CREATE A GRAPH IN A DATAWINDOW:
//1. Create a DataWindow that contains a graph object that is like the one that you want.
//2. Export the DataWindow object to a DOS file.
//3. Copy JUST the graph section into your script.
//4. Modify the graph section to meet your needs.
//5. Put the new graph definition into a string variable.
//NOTE: you will need to change existing quotes (") in the string to single quotes (').
//6. Code the Modify statement (see example below).
//EXAMPLE CREATING A 2D COLUMN GRAPH SHOWING AVERAGE SALARY BY DEPT.
//NOTE: Assumes that the DataWindow containing the graph has a dept_id and a salary column.
<DW Control Name>.Modify(&
"create graph(band=foreground x='220' y='38' height='1185' width='2305' graphtype='7' perspective='2' " + &
"rotation='-20' color='0' backcolor='16777215' shadecolor='8355711' range= 0 border='3' " + &
"overlappercent='0' spacing='100' elevation='20' depth='100' visible='1' name=gr_salary resizeable=1 moveable=1 " + &
"category='dept_id' values='avg(salary for graph)' title='Average Salary By Department' " + &
"title.dispattr.backcolor='553648127' title.dispattr.alignment='2' title.dispattr.autosize='1' " + &
"title.dispattr.font.charset='0' title.dispattr.font.escapement='0' title.dispattr.font.face='Tahoma' " + &
"title.dispattr.font.family='2' title.dispattr.font.height='1' title.dispattr.font.italic='0' " + &
"title.dispattr.font.orientation='0' title.dispattr.font.pitch='2' title.dispattr.font.strikethrough='0' " + &
"title.dispattr.font.underline='0' title.dispattr.font.weight='700' title.dispattr.format='[General]' " + &
"title.dispattr.textcolor='0' legend='4' legend.dispattr.backcolor='536870912' " + &
"legend.dispattr.alignment='0' legend.dispattr.autosize='1' legend.dispattr.font.charset='0' " + &
"legend.dispattr.font.escapement='0' legend.dispattr.font.face='Tahoma' legend.dispattr.font.family='2' " + &
"legend.dispattr.font.height='1' legend.dispattr.font.italic='0' legend.dispattr.font.orientation='0' " + &
"legend.dispattr.font.pitch='2' legend.dispattr.font.strikethrough='0' legend.dispattr.font.underline='0' " + &
"legend.dispattr.font.weight='400' legend.dispattr.format='[General]' legend.dispattr.textcolor='0' " + &
"series.autoscale='1' series.droplines='0' series.frame='1' series.label='(None)' " + &
"series.majordivisions='0' series.majorgridline='0' series.majortic='3' series.maximumvalue='0' " + &
"series.minimumvalue='0' series.minordivisions='0' series.minorgridline='0' series.minortic='1' " + &
"series.originline='0' series.primaryline='1' series.roundto='0' series.scaletype='1' " + &
"series.scalevalue='1' series.secondaryline='0' series.shadebackedge='0' " + &
"series.dispattr.backcolor='536870912' series.dispattr.alignment='0' series.dispattr.autosize='1' " + &
"series.dispattr.font.charset='0' series.dispattr.font.escapement='0' series.dispattr.font.face='Tahoma' " + &
"series.dispattr.font.family='2' series.dispattr.font.height='1' series.dispattr.font.italic='0' " + &
"series.dispattr.font.orientation='0' series.dispattr.font.pitch='2' series.dispattr.font.strikethrough='0' " + &
"series.dispattr.font.underline='0' series.dispattr.font.weight='400' series.dispattr.format='[General]' " + &
"series.dispattr.textcolor='0' series.labeldispattr.backcolor='553648127' " + &
"series.labeldispattr.alignment='2' series.labeldispattr.autosize='1' series.labeldispattr.font.charset='0' " + &
"series.labeldispattr.font.escapement='0' series.labeldispattr.font.face='Tahoma' " + &
"series.labeldispattr.font.family='2' series.labeldispattr.font.height='1' series.labeldispattr.font.italic='0' " + &
"series.labeldispattr.font.orientation='0' series.labeldispattr.font.pitch='2' " + &
"series.labeldispattr.font.strikethrough='0' series.labeldispattr.font.underline='0' " + &
"series.labeldispattr.font.weight='400' series.labeldispattr.format='[General]' " + &
"series.labeldispattr.textcolor='0' category.autoscale='1' category.droplines='0' category.frame='1' " + &
"category.label='Department' category.majordivisions='0' category.majorgridline='0' " + &
"category.majortic='3' category.maximumvalue='5' category.minimumvalue='0' " + &
"category.minordivisions='0' category.minorgridline='0' category.minortic='1' category.originline='0' " + &
"category.primaryline='1' category.roundto='0' category.scaletype='1' category.scalevalue='1' " + &
"category.secondaryline='0' category.shadebackedge='1' category.dispattr.backcolor='536870912' " + &
"category.dispattr.alignment='2' category.dispattr.autosize='1' category.dispattr.font.charset='0' " + &
"category.dispattr.font.escapement='0' category.dispattr.font.face='Tahoma' category.dispattr.font.family='2' " + &
"category.dispattr.font.height='1' category.dispattr.font.italic='0' category.dispattr.font.orientation='0' " + &
"category.dispattr.font.pitch='2' category.dispattr.font.strikethrough='0' " + &
"category.dispattr.font.underline='0' category.dispattr.font.weight='400' " + &
"category.dispattr.format='[General]' category.dispattr.textcolor='0' " + &
"category.labeldispattr.backcolor='553648127' category.labeldispattr.alignment='2' " + &
"category.labeldispattr.autosize='1' category.labeldispattr.font.charset='0' " + &
"category.labeldispattr.font.escapement='0' category.labeldispattr.font.face='Tahoma' " + &
"category.labeldispattr.font.family='2' category.labeldispattr.font.height='1' " + &
"category.labeldispattr.font.italic='0' category.labeldispattr.font.orientation='0' " + &
"category.labeldispattr.font.pitch='2' category.labeldispattr.font.strikethrough='0' " + &
"category.labeldispattr.font.underline='0' category.labeldispattr.font.weight='400' " + &
"category.labeldispattr.format='[General]' category.labeldispattr.textcolor='0' " + &
"values.autoscale='1' values.droplines='0' values.frame='1' values.label='Average Salary' " + &
"values.majordivisions='0' values.majorgridline='0' values.majortic='3' values.maximumvalue='1000' " + &
"values.minimumvalue='0' values.minordivisions='0' values.minorgridline='0' values.minortic='1' " + &
"values.originline='1' values.primaryline='1' values.roundto='0' values.scaletype='1' values.scalevalue='1' " + &
"values.secondaryline='0' values.shadebackedge='0' values.dispattr.backcolor='536870912' " + &
"values.dispattr.alignment='1' values.dispattr.autosize='1' values.dispattr.font.charset='0' " + &
"values.dispattr.font.escapement='0' values.dispattr.font.face='Tahoma' values.dispattr.font.family='2' " + &
"values.dispattr.font.height='1' values.dispattr.font.italic='0' values.dispattr.font.orientation='0' " + &
"values.dispattr.font.pitch='2' values.dispattr.font.strikethrough='0' values.dispattr.font.underline='0' " + &
"values.dispattr.font.weight='400' values.dispattr.format='[General]' values.dispattr.textcolor='0' " + &
"values.labeldispattr.backcolor='553648127' values.labeldispattr.alignment='2' " + &
"values.labeldispattr.autosize='1' values.labeldispattr.font.charset='0' " + &
"values.labeldispattr.font.escapement='900' values.labeldispattr.font.face='Tahoma' " + &
"values.labeldispattr.font.family='2' values.labeldispattr.font.height='1' " + &
"values.labeldispattr.font.italic='0' values.labeldispattr.font.orientation='0' " + &
"values.labeldispattr.font.pitch='2' values.labeldispattr.font.strikethrough='0' " + &
"values.labeldispattr.font.underline='0' values.labeldispattr.font.weight='400' " + &
"values.labeldispattr.format='[General]' values.labeldispattr.textcolor='0' )")