[]
Sheets.Sparklines.LollipopVariSparkline
↳ LollipopVariSparkline
• new LollipopVariSparkline()
ロリポップスパークラインのクラスを表します。
• typeName: string
シリアル化のサポートに使用される型名の文字列を表します。
▸ createFunction(): Function
SparklineExのデータと設定を提供するカスタム関数を作成します。
作成されたカスタム関数。
▸ fromJSON(settings): void
指定したJSON文字列からオブジェクト状態をロードします。
実例
window.MySparklineEx = function(color) {
GC.Spread.Sheets.Sparklines.SparklineEx.apply(this, arguments);
this.typeName = 'MySparklineEx';
this.color = color;
}
MySparklineEx.prototype = new GC.Spread.Sheets.Sparklines.SparklineEx();
MySparklineEx.prototype.createFunction = function () {
var func = new GC.Spread.CalcEngine.Functions.Function('CIRCLE', 0, 0);
func.evaluate = function (args) {
return {};
};
return func;
};
MySparklineEx.prototype.paint = function (context, value, x, y, width, height) {
context.beginPath();
context.arc(x + width / 2, y + height / 2, (Math.min(width, height) - 6) / 2, 0, Math.PI * 2);
context.strokeStyle = this.color;
context.stroke();
};
let sparkline = new MySparklineEx("green");
sparkline.fromJSON({ color: "red", typeName: "MySparklineEx" });
spread.addSparklineEx(sparkline);
sheet.setFormula(3,3,"=CIRCLE()");
| 名前 | 型 | 説明 |
|---|---|---|
settings |
Object |
逆シリアル化されたsparklineExのデータ。 |
void
▸ name(): string
SparklineExの名前を取得します。
実例
window.MySparklineEx = function(color) {
GC.Spread.Sheets.Sparklines.SparklineEx.apply(this, arguments);
this.typeName = 'MySparklineEx';
this.color = color;
}
MySparklineEx.prototype = new GC.Spread.Sheets.Sparklines.SparklineEx();
MySparklineEx.prototype.createFunction = function () {
var func = new GC.Spread.CalcEngine.Functions.Function('CIRCLE', 0, 0);
func.evaluate = function (args) {
return {};
};
return func;
};
MySparklineEx.prototype.paint = function (context, value, x, y, width, height) {
context.beginPath();
context.arc(x + width / 2, y + height / 2, (Math.min(width, height) - 6) / 2, 0, Math.PI * 2);
context.strokeStyle = this.color;
context.stroke();
};
let sparkline = new MySparklineEx('green');
console.log(sparkline.name());
string
SparklineExの名前。
▸ paint(context, value, x, y, width, height): void
キャンバスにSparklineExを描画します。
実例
window.MySparklineEx = function(color) {
GC.Spread.Sheets.Sparklines.SparklineEx.apply(this, arguments);
this.typeName = 'MySparklineEx';
this.color = color;
}
MySparklineEx.prototype = new GC.Spread.Sheets.Sparklines.SparklineEx();
MySparklineEx.prototype.createFunction = function () {
var func = new GC.Spread.CalcEngine.Functions.Function('CIRCLE', 0, 0);
func.evaluate = function (args) {
return {};
};
return func;
};
MySparklineEx.prototype.paint = function (context, value, x, y, width, height) {
context.beginPath();
context.arc(x + width / 2, y + height / 2, (Math.min(width, height) - 6) / 2, 0, Math.PI * 2);
context.strokeStyle = this.color;
context.stroke();
};
let sparkline = new MySparklineEx('green');
spread.addSparklineEx(sparkline);
let sheet = spread.getActiveSheet();
sheet.setFormula(3,3,"=CIRCLE()");
| 名前 | 型 | 説明 |
|---|---|---|
context |
CanvasRenderingContext2D |
キャンバスの2次元コンテキスト。 |
value |
any |
カスタム関数によって評価された値。 |
x |
number |
キャンバスを基準とする<i>x</i>座標。 |
y |
number |
キャンバスを基準とするy座標。 |
width |
number |
セルの幅。 |
height |
number |
セルの高さ。 |
void
▸ toJSON(): Object
オブジェクト状態をJSON文字列に保存します。
実例
window.MySparklineEx = function(color) {
GC.Spread.Sheets.Sparklines.SparklineEx.apply(this, arguments);
this.typeName = 'MySparklineEx';
this.color = color;
}
MySparklineEx.prototype = new GC.Spread.Sheets.Sparklines.SparklineEx();
MySparklineEx.prototype.createFunction = function () {
var func = new GC.Spread.CalcEngine.Functions.Function('CIRCLE', 0, 0);
func.evaluate = function (args) {
return {};
};
return func;
};
MySparklineEx.prototype.paint = function (context, value, x, y, width, height) {
context.beginPath();
context.arc(x + width / 2, y + height / 2, (Math.min(width, height) - 6) / 2, 0, Math.PI * 2);
context.strokeStyle = this.color;
context.stroke();
};
let sparkline = new MySparklineEx('green');
console.log(sparkline.toJSON()); // { color: "green", typeName: "MySparklineEx", _name: "CIRCLE" }
Object
sparklineExのデータ。