[]
↳ Chart
• new Chart(sheet
, name
, chartType
, x
, y
, width
, height
, dataRange?
, dataOrientation?
)
Represents a chart.
Name | Type | Description |
---|---|---|
sheet |
Worksheet |
The host sheet of the chart. |
name |
string |
The name of the chart. |
chartType |
ChartType |
The type of the chart. |
x |
number |
The x location of the chart. |
y |
number |
The y location of the chart. |
width |
number |
The width of the chart. |
height |
number |
The height of the chart. |
dataRange? |
string |
The formula string of data range for the chart. |
dataOrientation? |
RowCol |
The orientation of data for series. |
• typeName: string
Represents the type name string used for supporting serialization.
▸ allowMove(value?
): any
Gets or sets whether to disable moving the floating object.
example
//This example prevents you from moving or resizing the floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.allowResize(false);
customFloatingObject.allowMove(false);
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
Name | Type | Description |
---|---|---|
value? |
boolean |
The setting for whether to disable moving the floating object. |
any
If no value is set, returns the setting for whether to disable moving the floating object; otherwise, returns the floating object.
▸ allowResize(value?
): any
Gets or sets whether to disable resizing the floating object.
example
//This example prevents you from moving or resizing the floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.allowResize(false);
customFloatingObject.allowMove(false);
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
Name | Type | Description |
---|---|---|
value? |
boolean |
The setting for whether to disable resizing the floating object. |
any
If no value is set, returns the setting for whether to disable resizing the floating object; otherwise, returns the floating object.
▸ alt(value?
): any
Gets or sets the alternative text of the floating object for screen readers.
Name | Type | Description |
---|---|---|
value? |
string |
The alternative text of the floating object. |
any
The alternative text of the floating object.
▸ axes(value?
): any
Gets or sets the chart axes of the chart.
Name | Type | Description |
---|---|---|
value? |
IAxes |
The chart axes of the chart. |
any
If no value is set, returns the chart axes of the chart; otherwise, returns the chart.
The majorGridLine and minorGridLine have same type.
▸ chartArea(value?
): any
Gets or sets the chart area style of the chart.
Name | Type | Description |
---|---|---|
value? |
IChartArea |
The chart area style of the chart. |
any
If no value is set, returns the chart area style of the chart; otherwise, returns the chart.
▸ chartType(value?
): any
Gets or sets the type of the chart.
Name | Type | Description |
---|---|---|
value? |
ChartType |
The type of the chart. |
any
If no value is set, returns the type of the chart; otherwise, returns the chart.
▸ cloneContent(): HTMLElement
Gets a copy of the current content of the instance.
HTMLElement
A copy of the current content of the instance.
▸ content(value?
): any
Gets or sets the content of the custom floating object.
Name | Type | Description |
---|---|---|
value? |
HTMLElement |
The content of the custom floating object. |
any
If no value is set, returns the content of the custom floating object; otherwise, returns the floating object.
▸ dataLabels(value?
): any
Gets or sets the chart data labels style of the chart.
Name | Type | Description |
---|---|---|
value? |
IDataLabels |
The chart data labels style of the chart. |
any
If no value is set, returns the chart data labels style of the chart; otherwise, returns the chart.
▸ dataRange(value?
): any
Gets or sets the whole data range of the chart as formula string.
Name | Type | Description |
---|---|---|
value? |
string |
The formula string of the data range for the chart. |
any
If no value is set, returns the formula string of the whole data range for the chart; otherwise, returns the chart.
▸ displayBlanksAs(value?
): any
Gets or sets the way that the chart display blank data.
Name | Type | Description |
---|---|---|
value? |
DisplayBlanksAs |
the way that the chart display blank data. |
any
If no value is set, returns the way that the chart display blank data, otherwise, returns the chart.
▸ displayNaAsBlank(value?
): boolean
| Chart
Gets or sets whether to show #N/A cells as blank cells.
Name | Type | Description |
---|---|---|
value? |
boolean |
that whether to show #N/A cells as blank cells. |
boolean
| Chart
If no value is set, returns whether to show #N/A cells as blank cells, otherwise, returns the chart.
▸ dynamicMove(value?
): any
Gets or sets whether the object moves when hiding or showing, resizing, or moving rows or columns.
example
//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.isVisible(true);
customFloatingObject.dynamicSize(true);
customFloatingObject.dynamicMove(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
Name | Type | Description |
---|---|---|
value? |
boolean |
The value indicates whether the object moves when hiding or showing, resizing, or moving rows or columns. |
any
If no value is set, returns whether this floating object dynamically moves; otherwise, returns the floating object.
▸ dynamicSize(value?
): any
Gets or sets whether the size of the object changes when hiding or showing, resizing, or moving rows or columns.
example
//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.isVisible(true);
customFloatingObject.dynamicSize(true);
customFloatingObject.dynamicMove(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
Name | Type | Description |
---|---|---|
value? |
boolean |
The value indicates whether the size of the object changes when hiding or showing, resizing, or moving rows or columns. |
any
If no value is set, returns whether this floating object dynamically changes size; otherwise, returns the floating object.
▸ endColumn(value?
): any
Gets or sets the end column index of the floating object position.
example
//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//takes effect when added into the sheet.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
customFloatingObject.endRow(7);
customFloatingObject.endColumn(5);
customFloatingObject.endRowOffset(10);
customFloatingObject.endColumnOffset(10);
Name | Type | Description |
---|---|---|
value? |
number |
The end column index of the floating object position. |
any
If no value is set, returns the end column index of the floating object position; otherwise, returns the floating object.
▸ endColumnOffset(value?
): any
Gets or sets the offset relative to the end column of the floating object.
example
//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//takes effect when added into the sheet.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
customFloatingObject.endRow(7);
customFloatingObject.endColumn(5);
customFloatingObject.endRowOffset(10);
customFloatingObject.endColumnOffset(10);
Name | Type | Description |
---|---|---|
value? |
number |
The offset relative to the end column of the floating object. |
any
If no value is set, returns the offset relative to the end column of the floating object; otherwise, returns the floating object.
FloatingObject.endColumnOffset
▸ endRow(value?
): any
Gets or sets the end row index of the floating object position.
example
//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//takes effect when added into the sheet.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
customFloatingObject.endRow(7);
customFloatingObject.endColumn(5);
customFloatingObject.endRowOffset(10);
customFloatingObject.endColumnOffset(10);
Name | Type | Description |
---|---|---|
value? |
number |
The end row index of the floating object position. |
any
If no value is set, returns the end row index of the floating object position; otherwise, returns the floating object.
▸ endRowOffset(value?
): any
Gets or sets the offset relative to the end row of the floating object.
example
//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//takes effect when added into the sheet.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
customFloatingObject.endRow(7);
customFloatingObject.endColumn(5);
customFloatingObject.endRowOffset(10);
customFloatingObject.endColumnOffset(10);
Name | Type | Description |
---|---|---|
value? |
number |
The offset relative to the end row of the floating object. |
any
If no value is set, returns the offset relative to the end row of the floating object; otherwise, returns the floating object.
▸ fixedPosition(value
): any
Gets or sets whether the position of the floating object is fixed. When fixedPosition is true, dynamicMove and dynamicSize are disabled.
example
//This example sets the position of the object to fixed.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.fixedPosition(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
Name | Type | Description |
---|---|---|
value |
boolean |
The value indicates whether the position of the floating object is fixed. |
any
If no value is set, returns whether the position of the floating object is fixed; otherwise, returns the floating object.
▸ getHost(): HTMLElement
[]
Gets the dom host of the custom content.
HTMLElement
[]
▸ height(value?
): any
Gets or sets the height of a floating object.
example
//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
Name | Type | Description |
---|---|---|
value? |
number |
The height of a floating object. |
any
If no value is set, returns the height of a floating object; otherwise, returns the floating object.
▸ hoverStyle(value?
): any
Gets or sets the style when user hover over the dataPoint.
Name | Type | Description |
---|---|---|
value? |
IHoverStyle |
The hover style of the dataPoint been hovered. |
any
If no value is set, returns the current hover style of the chart; otherwise, returns the chart.
▸ ignoreHidden(value?
): boolean
| Chart
Gets or sets the way that if the chart display hidden rows and columns data.
Name | Type | Description |
---|---|---|
value? |
boolean |
the value that if the chart display hidden rows and columns data. |
boolean
| Chart
If no value is set, returns the value that if the chart display hidden rows and columns data, otherwise, returns the chart.
▸ isLocked(value?
): any
Gets or sets whether this floating object is locked.
example
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
customFloatingObject.isLocked(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
activeSheet.options.isProtected = true;
Name | Type | Description |
---|---|---|
value? |
boolean |
The value that indicates whether this floating object is locked. |
any
If no value is set, returns whether this floating object is locked; otherwise, returns the floating object.
▸ isSelected(value?
): any
Gets or sets whether this floating object is selected.
example
//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.isSelected(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
Name | Type | Description |
---|---|---|
value? |
boolean |
The value that indicates whether this floating object is selected. |
any
If no value is set, returns whether this floating object is selected; otherwise, returns the floating object.
▸ isVisible(value?
): any
Gets or sets whether this floating object is visible.
example
//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.isVisible(true);
customFloatingObject.dynamicSize(true);
customFloatingObject.dynamicMove(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
Name | Type | Description |
---|---|---|
value? |
boolean |
The value that indicates whether this floating object is visible. |
any
If no value is set, returns whether this floating object is visible; otherwise, returns the floating object.
▸ legend(value?
): any
Gets or sets the legend of the chart.
Name | Type | Description |
---|---|---|
value? |
IChartLegend |
The legend of the chart. |
any
If no value is set, returns the legend of the chart; otherwise, returns the chart.
▸ name(value?
): any
Gets the name of the floating object.
example
//This example uses the name method.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject();
customFloatingObject.name("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
Name | Type | Description |
---|---|---|
value? |
string |
The name of the floating object. |
any
If no value is set, returns the name of the floating object; otherwise, returns the floating object.
▸ refreshContent(): void
Refresh the content in floatingObject.The user should override this method to make their content synchronize with the floatingObject.
void
▸ series(): SeriesCollection
Gets the series collection of the chart.
Returns the series collection of the chart.
▸ startColumn(value?
): any
Gets or sets the starting column index of the floating object position.
example
//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//takes effect when added into the sheet.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
Name | Type | Description |
---|---|---|
value? |
number |
The starting column index of the floating object position. |
any
If no value is set, returns the starting column index of the floating object position; otherwise, returns the floating object.
▸ startColumnOffset(value?
): any
Gets or sets the offset relative to the start column of the floating object.
example
//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//takes effect when added into the sheet.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
Name | Type | Description |
---|---|---|
value? |
number |
The offset relative to the start column of the floating object. |
any
If no value is set, returns the offset relative to the start column of the floating object; otherwise, returns the floating object.
FloatingObject.startColumnOffset
▸ startRow(value?
): any
Gets or sets the starting row index of the floating object position.
example
//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//takes effect when added into the sheet.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
Name | Type | Description |
---|---|---|
value? |
number |
The starting row index of the floating object position. |
any
If no value is set, returns the starting row index of the floating object position; otherwise, returns the floating object.
▸ startRowOffset(value?
): any
Gets or sets the offset relative to the start row of the floating object.
example
//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//takes effect when added into the sheet.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
Name | Type | Description |
---|---|---|
value? |
number |
The offset relative to the start row of the floating object. |
any
If no value is set, returns the offset relative to the start row of the floating object; otherwise, returns the floating object.
▸ switchDataOrientation(): boolean
Switches the data orientation between rows and columns.
boolean
Returns true when data orienetation is changable and successful switched; otherwise, false.
▸ title(value?
): any
Gets or sets the title of the chart.
Name | Type | Description |
---|---|---|
value? |
IChartTitle |
The title of the chart. |
any
If no value is set, returns the title of the chart; otherwise, returns the chart.
▸ useAnimation(value?
): any
Gets or sets whether apply animation to the chart.
Name | Type | Description |
---|---|---|
value? |
boolean |
whether apply animation to the chart. |
any
If no value is set, returns whether apply animation to the chart; otherwise, returns the chart.
▸ width(value?
): any
Gets or sets the width of a floating object.
example
//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
Name | Type | Description |
---|---|---|
value? |
number |
The width of a floating object. |
any
If no value is set, returns the width of a floating object; otherwise, returns the floating object.
▸ x(value?
): any
Gets or sets the horizontal location of the floating object.
example
//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
Name | Type | Description |
---|---|---|
value? |
number |
The horizontal location of the floating object. |
any
If no value is set, returns the horizontal location of the floating object; otherwise, returns the floating object.
▸ y(value?
): any
Gets or sets the vertical location of the floating object.
example
//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
Name | Type | Description |
---|---|---|
value? |
number |
The vertical location of the floating object. |
any
If no value is set, returns the vertical location of the floating object; otherwise, returns the floating object.