[]
        
(Showing Draft Content)

GC.Spread.Sheets.Sparklines.LollipopVariSparkline

クラス: LollipopVariSparkline

Sheets.Sparklines.LollipopVariSparkline

階層

Table of contents

コンストラクタ

プロパティ

メソッド

コンストラクタ

constructor

new LollipopVariSparkline()

ロリポップスパークラインのクラスを表します。

オーバーライド

SparklineEx.constructor

プロパティ

typeName

typeName: string

シリアル化のサポートに使用される型名の文字列を表します。

継承元

SparklineEx.typeName

メソッド

createFunction

createFunction(): Function

SparklineExのデータと設定を提供するカスタム関数を作成します。

戻り値

Function

作成されたカスタム関数。

継承元

SparklineEx.createFunction


fromJSON

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

継承元

SparklineEx.fromJSON


name

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の名前。

継承元

SparklineEx.name


paint

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

継承元

SparklineEx.paint


toJSON

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のデータ。

継承元

SparklineEx.toJSON