<< Click to Display Table of Contents >> Chart Component Script |
❖Chart component script functions
Functions |
Instructions |
Examples |
---|---|---|
dodgeMark |
When there are multiple markers, set whether multiple markers overlap display |
Chart1.dodgeMark=false;//Overlapping display |
hiddenTip |
Whether to display the corresponding value of the marker when the mouse is hovered |
Chart2.hiddenTip=true;//Hide the display value |
overlapType |
Whether to superimpose chart labels, as detailed in the following table (chart label) |
Chart1.overlapType=OVERLAP_N; |
LineColor |
Grid line color |
Chart1.setLineColor(loc, 0xff2219); |
LineStyle |
Grid line style |
Chart1.setLineStyle(loc, THICK_LINE); |
Rotation |
Rotation angle |
Chart1.setRotation(loc, ROTATION_90); |
getTargetLine |
Get the target line of the chart |
Chart1.getTargetLine(0).name = "targetline1"; |
getTargetLineSize |
Get the number of target lines for the chart |
debug(Chart1.getTargetLineSize()); |
Bchart |
Original chart |
var bc= getBChart(); |
❖Chart label
Functions |
Instructions |
Examples |
---|---|---|
OVERLAP_A |
0 |
automatic |
OVERLAP_N |
1 |
Keep overlapping labels |
OVERLAP_S |
2 |
Disperse overlapping labels |
OVERLAP_R |
3 |
Remove overlapping labels |
❖Chart Component About Binding Script Functions
Functions |
Instructions |
Examples |
---|---|---|
axisPosition |
Axis display position, see the table below |
Chart1.binding.axis["Sum_price"].axisPosition=-2; |
base |
Base value |
Chart1.binding.axis["Sum_price"].base=500; |
discrete |
Is it a discrete axis |
Chart1.binding.axis["product"].discrete=true; |
everyN |
How many ticks to show labels |
Chart1.binding.axis["Sum_price"].everyN=3; |
Values |
Scale value |
var vals = [0, 152579, 814929, 1017986]; Chart1.binding.axis["Sum_sales"].setValues(vals); |
gridLineVisible |
Is the grid line visible |
Chart1.binding.axis["product"].gridLineVisible=false; |
ignoreNull |
Whether to ignore null values |
Chart1.binding.axis["product"].ignoreNull=true; |
labelPosition |
The location of the label |
Chart1.binding.axis["product"].labelPosition=LABEL_INNER;//LABEL_OUTER |
labelVisible |
Whether the label is visible |
Chart1.binding.axis["product"].labelVisible=false; |
lineVisible |
Is the axis visible |
Chart1.binding.axis["product"].lineVisible=false; |
logScala |
Whether it is a logarithmic scale |
Chart1.binding.axis["price"].logScala=false; |
majorIncrement |
Main scale |
Chart1.binding.axis["Sum_price"].majorIncrement=10000; |
max |
Maximum |
Chart1.binding.axis["Sum_price"].max=10000; |
min |
Min |
Chart1.binding.axis["Sum_price"].min=0; |
minorIncrement |
Minor scale |
Chart1.binding.axis["Sum_price"].minorIncrement=500; |
shareGroup |
Shared axis |
Chart1.binding.axis["Sum_profit"].shareGroup="shareAxis"; Chart1.binding.axis["Sum_sales"].shareGroup="shareAxis"; |
reversed |
Reversal |
Chart1.binding.axis["product"].reversed=true; |
tickPosition |
Scale position |
Chart1.binding.axis["product"].tickPosition=TICK_INNER;//TICK_OUTER、TICK_CROSS |
tickVisible |
Whether the scale is visible |
Chart1.binding.axis["product"].tickVisible=false; |
timeScala |
Is it timeline |
Chart1.binding.axis["product"].timeScala=false; |
visible |
Is it visible |
Chart1.binding.axis["product"].visible=false; |
colNumber |
The number of columns in the legend |
Chart1.binding.markCol["Sum_price"].colorLegend.colNumber=2; |
title |
title |
Chart1.binding.markCol["Sum_price"].colorLegend.title="a"; |
titleVisible |
Is the title visible |
Chart1.binding.markCol["Sum_price"].colorLegend.titleVisible=false; |
hiddenMeasures |
Hover to increase display of unbound metrics |
Chart1.binding.hiddenMeasures = [new MeasureCol(SUM, new BCol("ID", INTEGER, false))];//Increase the value of Sum_ID when hovering |
tipFormat |
Dynamic display of tip values |
Chart1.binding.markCol["Sum_PROFIT"].tipFormat = "{col[\"PRODUCT\"]}"; |
colorField |
To colorize the interface on the color line binding field |
var bcol=new BCol("nation",STRING,true); var qcol=new ChartDimCol(bcol); Chart1.binding.markCol["Sum_price"].colorField=qcol; |
colorGuide |
Set the color type, as detailed in the following table (beautiful interface - color) |
var d = new RainbowColorGuide(); Chart1.binding.markCol["Sum_price"].colorGuide=d; |
explode |
Detached pie chart |
Chart2.binding.markCol["Sum_price"].explode=20; |
innerRadius |
The inner radius of the circle |
Chart3.binding.markCol["Sum_price"].innerRadius=30; |
mType |
Chart marker type, see the table below (marker type) |
Chart1.binding.markCol["Sum_price"].mType=BAR; |
resetGroup |
Whether to reset when tag type is stacked |
Chart1.binding.markCol["Sum_price"].resetGroup=false; |
patternField |
To beautify the interface on the pattern / shape line binding field |
var bcol=new BCol("nation",STRING,true); var qcol=new ChartDimCol(bcol); Chart1.binding.markCol["Sum_price"].patternField=qcol; |
patternGuide |
To beautify the interface on the pattern / shape line binding field |
var d=new DefSPatternGuide(); Chart1.binding.markCol["Sum_price"].patternGuide=d; |
showPoints |
Whether to display the point |
Chart1.binding.markCol["Sum_price"].showPoints=false; |
showRline |
Baseline showing the dot plot |
Chart1.binding.markCol["Sum_price"].showRline=true; |
showValues |
Display tag value |
Chart1.binding.markCol["Sum_price"].showValues=true; |
sizeField |
Bind the field to the landscaping interface |
var bcol=new BCol("nation",STRING,true); var qcol=new ChartDimCol(bcol); Chart1.binding.markCol["Sum_price"].sizeField=qcol; |
sizeGuide |
Set the display size type, as detailed in the following table (beautiful interface - size) |
var d=new ContinuousSizeGuide(); Chart1.binding.markCol["Sum_price"].sizeGuide=d; |
sizeGuide.sizeRatio |
The width of the column displayed in the column-shaped chart is a multiple of the current width. The default size is 0, only positive integers are supported. |
Chart1.binding.markCol["Sum_ID"].sizeGuide.sizeRatio =2;(The display width is 2 times the current width) |
stackDim |
Stacked fields |
Chart1.binding.markCol["Sum_profit"].stackDim = "market"; |
stackAsBase |
Stacking base |
Chart1.binding.markCol["Sum_price"].stackAsBase=true; |
stackNeg |
Stacking negative numbers |
Chart1.binding.markCol["Sum_profit"].stackNeg=true; |
stackTotal |
Whether to display the accumulated sum value |
Chart1.binding.markCol["Sum_profit"].stackTotal = true; |
stackValues |
Whether to accumulate marker values |
Chart1.binding.markCol["Sum_price"].stackValues=true; |
startAngle |
Set the starting angle for the pie chart |
Chart1.binding.markCol["Sum_price"].startAngle="45"; |
textField |
Label field binding field on the landscaping interface |
var bcol=new BCol("nation",STRING,true); var qcol=new ChartDimCol(bcol); Chart1.binding.markCol["Sum_price"].textField=qcol; |
textGuide |
label |
var d=TextGuide(); Chart1.binding.markCol["Sum_price"].textGuide=d; |
addGrpCol |
Add a field to the grouping of the chart. The user needs to specify the location of the added field and the field name. |
var bcol=new BCol("nation",STRING,true); var qcol=new ChartDimCol(bcol); Chart1.binding.addGrpCol(1,qcol); |
addXCol |
Add a field to the Column axis of the chart. The user needs to specify the location of the added field and the field name. |
var bcol=new BCol("nation",STRING,true); var qcol=new ChartDimCol(bcol); Chart1.binding.addXCol(1,qcol); |
addYCol |
Add a field to the Row axis of the chart. The user needs to specify the position of the added field and the field name.
|
var bcol1=new BCol("price2",DOUBLE,false); var qcol1=new ChartMeasureCol(SUM,bcol1,null); Chart1.binding.addYCol(1,qcol1); |
aestheticSingle |
Is it a single beautification index? |
Chart1.binding.aestheticSingle=true; |
aggregate |
Whether the chart is aggregated |
Chart1.binding.aggregate=true; |
blend |
Mixed type |
Chart1.binding.blend=COORD_V; |
clearGrpCols |
Clear the packet data segment in the landscaping interface |
Chart1.binding.clearGrpCols(); |
clearXCols |
Clear all fields bound by the Column axis |
Chart1.binding.clearXCols(); |
clearYCols |
Clear all fields bound by the Row axis |
Chart1.binding.clearYCols(); |
getGrpCol |
Get Group Binding Field Information |
var b =Chart1.binding.getGrpCol(0); |
getXCol |
Get Column axis binding field information |
var b=Chart1.binding.getXCol(0); |
getYCol |
Get Row axis binding field information |
var b=Chart1.binding.getYCol(0); |
grpColCount |
Get the number of fields bound by the group |
var a =Chart1.binding.GrpColCount; |
grpCols |
All fields of the group |
var a=[qcol,qcol1]; Chart1.binding.yCols=a; |
removeGrpCol |
Remove the specified field in the group |
Chart1.binding.removeGrpCol(0); |
removeXCol |
Remove the specified field on the Column axis |
Chart1.binding.removeXCol(0); |
removeYCol |
Remove the specified field on the Row axis |
Chart1.binding.removeYCol(0); |
setGrpCol |
Replace specific fields in the group |
var col=new BCol("nation",STRING,true); var qcol=new ChartDimCol(col); Chart1.binding.setGrpCol(0,qcol); |
setXCol |
Replace X-axis specific fields |
var col=new BCol("nation",STRING,true); var qcol=new ChartDimCol(col); Chart1.binding.setXCol(0,qcol); |
setYCol |
Replace Y-axis specific field |
var bcol1=new BCol("price2",DOUBLE,false); var qcol=new ChartMeasureCol(SUM,bcol1,null); Chart1.binding.setYCol(0,qcol); |
xColCount |
Get the number of fields bound by the Column axis |
var a=Chart1.binding.xColCount; |
xCols |
All fields on the Column axis |
var a=[qcol,qcol1]; Chart1.binding.xCols=a; |
yColCount |
Get the number of fields bound by the Column axis |
var a=Chart1.binding.yColCount; |
yCols |
All fields on the Row axis |
var a=[qcol,qcol1]; Chart1.binding.yCols=a; |
❖Axis position
Functions |
Instructions |
Examples |
---|---|---|
AXIS_BOTTOM_LEFT |
-1 |
Left/down |
AXIS_UPPER_RIGHT |
-2 |
Right/up |
AXIS_AUTO |
-3 |
automatic |
❖mark type
Functions |
Instructions |
Examples |
---|---|---|
AUTO |
0 |
Auto |
BAR |
1 |
Bar |
STACK_BAR |
513 |
Stacked bar |
STACK_BAR_NORESET |
1537 |
Stacked bar(no reset) |
BAR_3D |
257 |
3D bar |
STACK_BAR_3D |
769 |
3D Stacked bar |
STACK_BAR_3D_NORESET |
1793 |
3D Stacked bar(no reset) |
LINE |
2 |
Line |
STACK_LINE |
514 |
Stacked Line |
POINT |
4 |
scattle plot |
STACK_POINT |
516 |
Stacked scattle plot |
STACK_PIONT_NORESET |
1540 |
Stacked scattle plot(no reset) |
AREA |
8 |
Area |
STACK_AREA |
520 |
Stacked area |
STACK_AREA_NORESET |
1544 |
Stacked area(no reset) |
PIE |
528 |
Pie |
PIE_3D |
784 |
3D Pie |
DONUT |
544 |
Donut |
RADAR |
64 |
Radar |
FILLED_RADAR |
128 |
Color-filled radar |
WATERFALL |
515 |
Waterfall |
PARETO |
5 |
Pareto |
MAP |
6 |
Map |
Organize |
11 |
Tree structure |
HeatMap |
14 |
Heat map |
BoxPlot |
13 |
Box-and-whishker plot |
❖Landscaping interface - color
Functions |
Instructions |
Examples |
---|---|---|
DefColorGuide |
The default color type |
var d = new DefColorGuide(java.awt.Color.red); Chart1.binding.markCol['Sum_price'].colorGuide= d;//Call the color provided by java |
DiscreteColorGuide |
Discrete color types |
var d=DiscreteColorGuide(); Chart1.binding.markCol["Sum_price"].colorGuide=d; |
BrightnessColorGuide |
Measure, the user can not set the parameters, call the default color; or call d.setBaseColor (Color color) to set the reference color |
var color=new Color(java.awt.Color.red); var d=new BrightnessColorGuide(); d.setBaseColor(color); Chart1.binding.markCol["Sum_price"].colorGuide=d; |
GradientColorGuide |
Set the initial color and end color of the gradient |
var color=new Color(java.awt.Color.red); var color2=new Color(java.awt.Color.blue); var d=new GradientColorGuide(); d.setStartColor(color); d.setEndColor(color2); Chart1.binding.markCol["Sum_price"].colorGuide=d; |
RainbowColorGuide |
Rainbow, no parameters |
var d = new RainbowColorGuide(); Chart1.binding.markCol["Sum_price"].colorGuide=d; |
SaturationColorGuide |
Saturation, the user can call the default color without setting parameters, or call d.setBaseColor(Color color) to set the reference color |
var color=new Color(java.awt.Color.red); var d=new SaturationColorGuide(); d.setBaseColor(color); Chart1.binding.markCol["Sum_price"].colorGuide=d; |
❖Landscaping interface - shape
Functions |
Instructions |
Examples |
---|---|---|
DefSPatternGuide |
The default shape type |
var d=new DefSPatternGuide(); Chart1.binding.markCol["Sum_price"].patternGuide=d; |
DBDiscreteSPatternGuide |
Discrete shape |
var d=new DiscreteSPatternGuide(); Chart1.binding.markCol["Sum_price"].patternGuide=d; |
TrapezoidSPatternGuide |
Trapezoidal |
var d=new TrapezoidSPatternGuide(); Chart1.binding.markCol["Sum_price"].patternGuide=d; |
PolygonSPatternGuide |
Polygonal drawing |
var d=new PolygonSPatternGuide(); Chart1.binding.markCol["Sum_price"].patternGuide=d; |
FillCircleSPatternGuide |
Filled circle |
var d=new FillCircleSPatternGuide(); Chart1.binding.markCol["Sum_price"].patternGuide=d; |
❖Landscaping interface - pattern
Functions |
Instructions |
Examples |
---|---|---|
DefTPatternGuide |
The default pattern type |
var d=new DefTPatternGuide(); Chart1.binding.markCol["Sum_price"].patternGuide=d; |
DBDiscreteTPatternGuide |
Discrete pattern |
var d=new DiscreteTPatternGuide(); Chart1.binding.markCol["Sum_price"].patternGuide=d; |
VerticalTPatternGuide |
Longitudinal |
var d=new VerticalTPatternGuide(); Chart1.binding.markCol["Sum_price"].patternGuide=d; |
TiltGridTPatternGuide |
Diagonal lattice |
var d=new TiltGridTPatternGuide(); Chart1.binding.markCol["Sum_price"].patternGuide=d; |
RTiltTPatternGuide |
Right tilt |
var d=new RTiltTPatternGuide(); Chart1.binding.markCol["Sum_price"].patternGuide=d; |
LTiltTPatternGuide |
Left leaning |
var d=new RTiltTPatternGuide(); Chart1.binding.markCol["Sum_price"].patternGuide=d; |
HorizontalTPatternGuide |
Horizontal |
var d=new HorizontalTPatternGuide(); Chart1.binding.markCol["Sum_price"].patternGuide=d; |
GridTPatternGuide
|
Grid |
var d=new GridTPatternGuide(); Chart1.binding.markCol["Sum_price"].patternGuide=d; |
❖Landscaping interface - size
Functions |
Instructions |
Examples |
---|---|---|
DefSizeGuide |
Product default |
var d=new DefSizeGuide(); Chart1.binding.markCol["Sum_price"].sizeGuide=d; |
DiscreteSizeGuide |
Discrete |
var d=new DiscreteSizeGuide(); Chart1.binding.markCol["Sum_price"].sizeGuide=d; |
ContinuousSizeGuide |
continuous |
var d=new ContinuousSizeGuide(); Chart1.binding.markCol["Sum_price"].sizeGuide=d; |
❖mixing
Functions |
Instructions |
Examples |
---|---|---|
COORD_H |
1 |
horizontal |
COORD_V |
2 |
vertical |
COORD_O |
4 |
overlapping |
❖Chart component scripting functions for legends
Functions |
Instructions |
Examples |
---|---|---|
bounds |
Legend border |
Chart1.legends.bounds=[140,150,5,5] |
legendAlign |
The alignment of the legend, see the following table (the alignment of the legend) |
Chart1.legends.legendAlign=VERTICAL; |
position |
The location of the legend |
Chart1.legends.position=LEFT;//LEFT、RIGHT 、UPPER 、BOTTOM、FLOATABLE |
scrollable |
Whether to support scrolling of legend content |
Chart1.legends.scrollable=false; |
❖Alignment of legends
Alignment |
Corresponding constants |
Notes |
---|---|---|
AUTO |
0 |
Auto |
VERTICAL |
1 |
Vertical |
HORIZONTAL |
2 |
Horizontal |
❖Chart component scripting functions for row/column axis titles
Functions |
Instructions |
Examples |
---|---|---|
bounds |
The border of the title |
ytitle.bounds=[0,100,200,300]; |
position |
The position of the title |
Chart1.xtitle.position=UPPER;//LEFT、RIGHT、BOTTOM、FLOATABLE |
title |
Title of the title |
ytitle.title="product"; |
visible |
Is the title visible |
ytitle.visible=true; |
❖Chart component scripting function on the target line
Functions |
Instructions |
Examples |
---|---|---|
name |
Set the name of the target line |
Chart1.getTargetLine(0).name="Target line 1”; |
val |
Set the target line value |
Chart1.getTargetLine(0).val="100000"; |
startVal |
Set the starting value of the target line |
Chart1.getTargetLine(0).startVal="20000"; |
measure |
Set metrics for the target line |
Chart1.getTargetLine(0).measure="Sum_profit"; |
hiddenLB |
Set whether the label is displayed |
Chart1.getTargetLine(0).hiddenLB=true; |
lineStyle |
Set the target line style, see the table below (Border type table) |
Chart1.getTargetLine(0).lineStyle="49"; |
lineColor |
Set the target line color |
Chart1.getTargetLine(0).lineColor=333; |
fillColor |
Set the fill color between the start value and the target value |
Chart1.getTargetLine(0).fillColor=333; |
setFillAlpha(byte fillAlpha) |
Set the transparency between the start value and the target value |
Chart1.getTargetLine(0).setFillAlpha(30); |
getFillAlpha |
Get the transparency between the start value and the target value |
Chart1.getTargetLine(0).getFillAlpha(); |
labelColor |
Set label color |
Chart1.getTargetLine(0).labelColor=333; |
labelAlign |
Set label alignment, see table (Alignment) |
Chart1.getTargetLine(0).labelAlign=LEFT_ALIGN; |
labelFont |
Set label font attributes, including style, style, size, underline, etc. |
var font=new GFont(“宋体”,BOLD,30); font.underline=1; font.strikeline=2; Chart1.getTargetLine(0).font=font;
|