Chart (クラス)
public abstract Chart {inherits Shape}
パッケージ: CURL.GUI.CHARTS
直接継承しているサブクラス: LayeredChart, PieChart

データドリブン グラフを表す抽象クラス。実装には LayeredChartPieChart があります。

説明

ChartShape オブジェクトです。ShapeGraphic オブジェクトではありませんが、ShapeBoxChartBox または Canvas を使用して標準グラフィック階層に表示できます。ChartBox は、Chart をグラフィック階層に挿入すると、常に暗黙的に作成されます。CURL.GUI.CHARTS のほとんどの例は、この特性を使用するものです。また、ChartBox を明示的に作成することによって、グラフの周りを境界線で囲んだり、グラフに背景色を付けたりすることもできます。あるいは、Chart を、他の Shape とともに Canvas に配置することもできます。
グラフ作成のほとんどの要素は、実際の実装にデリゲートされます。Chart クラスを使用して、グラフ レイアウト システムを制御し、高度な凡例の作成と配置を管理することができます。
レイアウトについては、Chart.invalidate-layout を参照してください。Chart レベルでの凡例の作成については、Chart.create-legendChart.legend-factory、および Chart.legend-entry-factory を参照してください。

コンストラクタ
default:新しい Chart オブジェクトを作成します。
コンストラクタ public {Chart.default
width:Distance = -1m,
height:Distance = -1m,
legend-location:LegendLocation = LegendLocation.right,
legend-alignment:double = 0.2,
color-palette:{Array-of FillPattern} = default-chart-color-palette,
...
}

プロパティ
bottom-margin:Chart の下の余白に割り当てられたスペースの量。
ローカル オプション public Chart.bottom-margin:any =null
color-palette:データ系列のプロット時に使用される FillPattern の配列。
フィールド public Chart.color-palette:{Array-of FillPattern}
default-height:高さが指定されていない場合に、この Chart が使用する高さ。
アクセサ public Chart.default-height:Distance
default-width:幅が指定されていない場合に、この Chart が使用する幅。
アクセサ public Chart.default-width:Distance
display-context:このオブジェクトに関連付けられている DisplayContext
非ローカル オプション public Chart.display-context:#DisplayContext
font-family:テキストのフォント書体を設定します。
非ローカル オプション public Chart.font-family:String
font-size:オブジェクト内のテキストの既定サイズを指定します。
非ローカル オプション public Chart.font-size:any
font-style:オブジェクト内のテキストを斜体や斜投影法などのフォントにするかどうかを指定します。
非ローカル オプション public Chart.font-style:FontStyle
font-weight:オブジェクト内のテキストを、太字として強調表示するかどうかを指定します。
非ローカル オプション public Chart.font-weight:FontWeight
height:グラフの現在の高さ。
フィールド public-get private-set Chart.height:Distance =-1m
layout-scheduled?:この Chart でレイアウト操作が保留中であるかどうかを示します。
アクセサ public final Chart.layout-scheduled?:bool
left-margin:Chart の左の余白に割り当てられたスペースの量。
ローカル オプション public Chart.left-margin:any =null
legend-alignment:Chart.legend-location で選択されたグラフの辺に沿った凡例の配置。
アクセサ public Chart.legend-alignment:double
セッター public Chart.legend-alignment:double
legend-enabled?:Chart の凡例作成を有効または無効にするために使用できる bool
非ローカル オプション public Chart.legend-enabled?:bool
legend-entry-factory:Chart の凡例の個別の凡例項目を生成するために使用されるファクトリ プロシージャ。
非ローカル オプション public Chart.legend-entry-factory:LegendEntryFactory
legend-factory:Chart の凡例を表す Graphic の生成のためのファクトリ。
ローカル オプション public Chart.legend-factory:Chart.LegendFactory =Chart.default-legend-factory
legend-location:グラフの凡例の位置 (LegendLocation を使用して定義されます)。
アクセサ public Chart.legend-location:LegendLocation
セッター public Chart.legend-location:LegendLocation
legend-shape:凡例を格納するために使用される GraphicShape オブジェクト (ある場合)。
フィールド public constant Chart.legend-shape:GraphicShape
plot-area-bounds:このグラフ内でプロットに使用されるエリア。
フィールド public constant Chart.plot-area-bounds:GRect ={GRect.empty}
right-margin:Chart の右の余白に割り当てられたスペースの量。
ローカル オプション public Chart.right-margin:any =null
style-element:スタイリングの目的のための、この Visual の "要素" や "型" です。
アクセサ public Chart.style-element:String
text-line-through?:オブジェクト内のテキストに、取り消し線を適用するかどうかを指定します。
非ローカル オプション public Chart.text-line-through?:bool
text-underline?:このオブジェクト内のテキストに、下線を引かれるかどうかを指定します。
非ローカル オプション public Chart.text-underline?:bool
top-margin:Chart の上の余白に割り当てられたスペースの量。
ローカル オプション public Chart.top-margin:any =null
width:グラフの現在の幅。
フィールド public-get private-set Chart.width:Distance =-1m
プロパティ 継承 Shape: as-Shape, border-color, color, draw-operation, option-parent, selection-context, shape-parent, shape-selectable, stroke-thickness, transformation, visible?
プロパティ 継承 ShapeContainerBase: as-ShapeRoot, shape-children
プロパティ 継承 Visual: _style-element, clonable-class?, completely-clonable-children?, cursor, data-source, dragee, input-method-enabled?, input-method-keyboard-mode, name, options, options-present-here, style-class, style-manager, style-options, test-description, test-name, test-parent?, test-type-name, test-visible?, tooltip, user-data
プロパティ 継承 DataBindingTarget: data-binding-context, data-bindings
プロパティ 継承 EventTarget: event-handlers
プロパティ 継承 OptionListInterface: option-register-proc, registered-option-keys

クラス変数と定数
LegendFactory:Chart の凡例の生成に使用されるファクトリー プロシージャの Type。これは、オプション Chart.legend-factory の型です。
public constant Chart.LegendFactory:ProcType ={proc-type {chart:Chart, include-scrollbox?:bool }:#Graphic }

クラス プロシージャ
default-legend-entry-factory:標準凡例項目を作成します。
public {Chart.default-legend-entry-factory
chart:Chart,
data-series:ChartDataSeries,
record:#Record,
color:FillPattern,
legend-index:int
}:Graphic
default-legend-factory:標準垂直方向レイアウトの凡例を作成します。
public {Chart.default-legend-factory
chart:Chart,
include-scrollbox?:bool
}:#Graphic

メソッド
constrain-own-layout-bounds:境界制約 (ローカル座標系) をこの Shape に適用します。
public {Chart.constrain-own-layout-bounds
lc:LayoutContext,
bounds:GRect
}:void
create-legend:このグラフの凡例 Graphic を作成します。
public {Chart.create-legend include-scrollbox?:bool = false}:#Graphic
draw:このオブジェクトの可視表現を描画します。
public {Chart.draw renderer2d:Renderer2d}:void
ensure-layout-valid:保留中のレイアウト処理が直ちに実行されるように強制します。
public {Chart.ensure-layout-valid force-layout?:bool = false}:void
estimate-margins:この Chart の必要余白を概算します。
protected abstract {Chart.estimate-margins
need-left?:bool,
need-right?:bool,
need-top?:bool,
need-bottom?:bool,
left:Distance,
right:Distance,
top:Distance,
bottom:Distance
}:(left:Distance, right:Distance, top:Distance, bottom:Distance)
get-actual-bottom-margin:Chart の下の余白に使用される実際の値を返します。
public final {Chart.get-actual-bottom-margin}:Distance
get-actual-left-margin:Chart の左の余白に使用される実際の値を返します。
public final {Chart.get-actual-left-margin}:Distance
get-actual-right-margin:Chart の右の余白に使用される実際の値を返します。
public final {Chart.get-actual-right-margin}:Distance
get-actual-top-margin:Chart の上の余白に使用される実際の値を返します。
public final {Chart.get-actual-top-margin}:Distance
get-legend-entries:この Chart の凡例に必要なすべての項目を作成します。
public abstract {Chart.get-legend-entries}:{Array-of Graphic}
get-own-bounds:ローカル座標系におけるこの Shape の四角形のレンダリング境界を計算します。
public {Chart.get-own-bounds dest:GRect = {GRect.empty}}:GRect
get-shape-layout-bounds:このオブジェクトのローカル座標系における、このオブジェクトとその子の四角形のレイアウト境界を計算します。
public {Chart.get-shape-layout-bounds
lc:LayoutContext,
width-first?:bool = true,
dest:GRect = {GRect.empty}
}:GRect
invalidate-layout:Chart がすぐにレイアウト操作を実行するように要求します。
public {Chart.invalidate-layout}:void
layout-chart:このチャートにおけるレイアウトの現在のプロセスを実行します。
public {Chart.layout-chart}:void
note-color-palette-changed:この ChartChart.color-palette の内容が変更されたことを通知します。
public {Chart.note-color-palette-changed}:void
position-legend:凡例を Chart 内に位置付けます。
public {Chart.position-legend}:void
request-draw:描画する Visual に属するピクセルを確認します。
public {Chart.request-draw
layout-context:LayoutContext = {self.get-layout-context}
}:void
self-contains-point?:ポイントがこの Shape 内にあるかどうかを判定します。
public {Chart.self-contains-point? x:Distance, y:Distance}:bool
self-intersects-polygon?:ポリゴンがこの Shape と交差するかどうかを判定します。
public {Chart.self-intersects-polygon?}:bool
set-chart-size:Chart のサイズを設定します。
public {Chart.set-chart-size width:Distance, height:Distance}:void
to-Graphic:このオブジェクトに値する Graphic を返します。
public {Chart.to-Graphic}:Graphic
transformation-changed:Shape.transformation が変更されたことの通知。
public {Chart.transformation-changed}:void
update-layout:Chart.plot-area-bounds に基づいてレイアウト操作を実行します。
protected abstract {Chart.update-layout}:void
メソッド 継承 Shape: apply-rotation, apply-scale, apply-transformation, apply-translation, apply-translation-in-parent, constrain-shape-layout-bounds, contains-point?, detach, find-graphical-ancestor, fire-crossing-event, fire-in-child, get-display-context, get-down-orientation-in-shape-parent, get-graphical-root, get-local-device-pixel-size, get-origin-in-graphical-ancestor, get-origin-in-root, get-origin-in-shape-parent, get-origin-in-shape-root, get-own-bounds-in-shape-root, get-own-layout-bounds, get-right-orientation-in-shape-parent, get-shape-bounds, get-shape-bounds-in-shape-root, get-top-left-in-ancestor, get-transformation-to-shape-root, keyword-init-arg, option-change-notify, overdraw-for-selection, quantize-line-thickness, request-draw-self, reset-transformation, set-rotation, set-scale, set-transformation, set-translation-in-parent, transform-from-display-coordinates, transform-from-graphical-root-coordinates, transform-point-from-shape-root, transform-point-to-shape-root, transform-to-display-coordinates, transform-to-graphical-root-coordinates, transform-vector-from-shape-root, transform-vector-to-shape-root, transformation-changing
メソッド 継承 ShapeContainerBase: add, clear, draw-shape-child, draw-shape-children, get-all-children-at-point, get-child-at-point, get-leaf-at-point, get-shape-root, note-attached, note-detaching, notify-option-children, on-drag-enter, on-pointer-enter, on-pointer-envelope-event, register-options, remove, set-shape-index, set-shape-index-after, set-shape-index-before, shape-container-fire-inferior-crossing-event, shape-container-handle-crossing, shape-container-pick-child, shape-container-pointer-enter-occurred, shape-container-pointer-leave-occurred
メソッド 継承 Visual: add-from-init-args, add-option, add-style-option, animate, change-cursor, clonable-appearance?, clone-appearance, clone-appearance-helper, find-test-children, get-focus-manager, get-layout-context, get-test-parent, get-test-property, get-text, get-view, maybe-fire-attach-event, maybe-fire-detach-event, non-keyword-init-arg, note-caret-position, on-drag-leave, on-pointer-leave, pop-cursor, prepare-test-object, prepare-test-parent, push-cursor, quantize-width, release-key-focus, remove-option, remove-style-option, request-key-focus, scroll-to-include, test-record, test-run, xy-offset-to
メソッド 継承 GraphicOptions: any-to-Distance
メソッド 継承 GuiEventTarget: handle-event, on-action, on-cancel-mode, on-command-changed, on-commit, on-composition-change-event, on-composition-result-event, on-context-menu-event, on-current-record-change-request, on-current-record-changed, on-destroy-notify, on-destroy-requested, on-drag-over, on-drag-pointer, on-drag-started, on-drop, on-end-composition-event, on-focus-event, on-focus-in, on-focus-out, on-grab-release, on-gui-event, on-input-method-event, on-inspection, on-key-event, on-key-press, on-pointer-button, on-pointer-crossing, on-pointer-event, on-pointer-motion, on-pointer-press, on-pointer-release, on-pointer-scroll, on-raw-key-event, on-raw-key-press, on-raw-key-release, on-reset, on-selectable-added, on-selectable-removed, on-selection-changed, on-selection-context-activated, on-selection-context-deactivated, on-selection-event, on-start-composition-event, on-start-event, on-stop-event, on-view-activate, on-view-deactivate, on-window-close, remove-event-handlers-for-event-class
メソッド 継承 DataBindingTarget: add-data-binding, get-data-binding, refresh-data-binding, remove-data-binding, unset-property, update-data-binding, validate-data-binding
メソッド 継承 EventTarget: accepts-event-class?, add-event-handler, event-handler-present?, remove-event-handler, verify-event
メソッド 継承 OptionListInterface: change-option-parent-notify, clone-options, get-option, get-option-by-name, local-add-notify, local-remove-notify, name-to-option-key, new-option-item, option-changed, option-lookup, option-lookup-here, option-propagate-notify, option-set?, propagate-option-change, remove-styles, set-option-by-name, set-style-option-by-name, unset-option-by-name, unset-style-option-by-name
メソッド 継承 BasicEventTarget: enqueue-event
メソッド 継承 InitRestArgParser: process-rest-args
メソッド 継承 Object: object-describe, object-describe-for-debugging, object-serialize



コンストラクタ詳細
default (コンストラクタ)
public {Chart.default
width:Distance = -1m,
height:Distance = -1m,
legend-location:LegendLocation = LegendLocation.right,
legend-alignment:double = 0.2,
color-palette:{Array-of FillPattern} = default-chart-color-palette,
...
}

新しい Chart オブジェクトを作成します。

width: グラフの初期幅。Chart.width を参照してください。
height: グラフの初期の高さ。Chart.height を参照してください。
legend-location: 凡例の初期位置。Chart.legend-location を参照してください。
legend-alignment: 凡例の初期配置。Chart.legend-alignment を参照してください。
color-palette: データ系列のプロット時に使用される FillPattern の配列。詳細については、Chart.color-palette を参照してください。
...: コンストラクタ Shape.default に渡される引数。キーワード引数を使用してオプションを初期化できます。非キーワード引数には、このオブジェクトの子として追加される EventHandlerDataBinding、または Shape オブジェクトを使用できます。

説明

このコンストラクタは、Chart のサブクラスによってのみ使用されます。



プロパティ詳細
bottom-margin (ローカル オプション)
public Chart.bottom-margin:any =null

Chart の下の余白に割り当てられたスペースの量。

説明

レイアウト操作および余白の役割については、Chart.height および Chart.plot-area-bounds を参照してください。このオプションとグラフの内容に基づいて実際の結果を計算する、Chart.get-actual-bottom-margin も参照してください。
有効な値の型は次のとおりです。
既定値は null で、Chart に、非プロット要素を格納する必要余白を見積もり、その値を使用するように指示します。
有効な値の例としては次のものがあります。
  • 2cm
  • 1.5in
  • 36pt
  • 3px
  • 36 (これは 36pt と同じです)
値をピクセルに換算して数量化する方法については、Shape.quantize-line-thickness を参照してください。

例については、Chart.left-margin を参照してください。


color-palette (フィールド)
public Chart.color-palette:{Array-of FillPattern}

データ系列のプロット時に使用される FillPattern の配列。

説明

各データ系列がプロットされている間、この配列が繰り返されます。このように、最初の FillPattern は最初のデータ系列に対して使用され、2 番目の FillPattern は 2 番目のデータ系列に対して使用され、以降同様に行われます。データ系列の数がこの配列の要素より多い場合は、もう一度始めから繰り返されます。
既定では、この値は default-chart-color-palette を参照するので、この配列は同じアプレット内のすべてのグラフで共有されます。
使用される色を変更するには、別の配列を使用するようにこのフィールドを設定するか、default-chart-color-palette を直接変更します。ただし、いずれの場合も、Chart.note-color-palette-changed を呼び出すことによって、その配列を使用しているグラフに変更を通知する必要があります。

注意事項

代替組み込みパレットが存在します。pastel-chart-color-palette を参照してください。

この例は、棒グラフの色としての LinearGradientFillPattern の使用法を示しています。

{import * from CURL.GUI.CHARTS}
{import * from CHARTS-DOC,
    location = "../docstring-support/gui/charts-doc.scurl"
}

{define-proc package {h-gradient
                         start-color:FillPattern,
                         highlight-color:FillPattern,
                         end-color:FillPattern,
                         highlight-pos:double = 0.2
                     }:FillPattern
    {return
        {LinearGradientFillPattern
            {Fraction2d 0, 0},
            {Fraction2d 1, 0},
            {Spectrum.from-envelope
                start-color,
                0.0,
                highlight-color,
                highlight-pos,
                end-color,
                1.0
            }
        }
    }
}

{LayeredChart
    width = 15cm,
    height = 6cm,
    color-palette =
        {new {Array-of FillPattern},
            {h-gradient "gray", "white", "gray"},
            {h-gradient "blue", "lavender", "steelblue"},
            {h-gradient "red", "mistyrose", "crimson"},
            {h-gradient "purple", "lavender", "blueviolet"},
            {h-gradient "lime", "mintcream", "green"}
        },
    {BarLayer
        sample-records,
        "Wins",
        "Points",
        "Age"
    }
}
次の例では、ドロップダウン リストを使用して、配列の最初の要素を変更できます。グローバル配列が変更されることに注意してください。このアプレットに他のグラフがあった場合は、このグラフに特殊な配列を使用するか、他のグラフにも変更を通知する必要があります。

{import * from CURL.GUI.CHARTS}
{import * from CHARTS-DOC,
    location = "../docstring-support/gui/charts-doc.scurl"
}
{RecordGrid height = 6cm, record-source = sample-records}

{let chart:LayeredChart =
    {LayeredChart
        width = 15cm,
        height = 6cm,
        left-axis = {new {NumericAxis-of double}, 0, 70},
        right-axis = {ChartAxis {ChartDataSeries sample-records, "Height"}},
        {BarLayer
            {ChartDataSeries sample-records, "Age"},
            {ChartDataSeries sample-records, "Wins"},
            {ChartDataSeries sample-records, "Height"},
            x-axis-data = {ChartDataSeries sample-records, "Name"}
        }
    }
}

{value chart}

First element of color-palette:
{DropdownList
    "black", "blue", "turquoise", "purple", "crimson",
    list-item-creation-proc =
        {proc {val:any}:ListItem
            {return
                {ListValueItem
                    value=val,
                    {RectangleGraphic fill-color=val,
                        width=50pt, height=10pt
                    }
                }
            }
        },
    {on ValueChanged at ddl:DropdownList do
        set chart.color-palette[0] = ddl.value asa FillPattern
        {chart.note-color-palette-changed}
    }
}


default-height (アクセサ)
アクセサ public Chart.default-height:Distance

高さが指定されていない場合に、この Chart が使用する高さ。

説明

Chart は、get-own-bounds のサイズ設定を宣言する必要があります。このためコンストラクタまたは set-chart-size で設定が指定されていない (あるいは負数が指定されている) 場合、代わりにこの値が使用されます。


default-width (アクセサ)
アクセサ public Chart.default-width:Distance

幅が指定されていない場合に、この Chart が使用する幅。

説明

Chart は、get-own-bounds のサイズ設定を宣言する必要があります。このためコンストラクタまたは set-chart-size で設定が指定されていない (あるいは負数が指定されている) 場合、代わりにこの値が使用されます。


display-context (非ローカル オプション)
public Chart.display-context:#DisplayContext

このオブジェクトに関連付けられている DisplayContext

プログラミング注意事項

このオプションは、Curl グラフィック システム内での通信のために使用されます。これは、ユーザー コードで不用意に設定や設定解除を行わないでください。また、通常は、ユーザー コードで直接読み取るべきではありません。現在の DisplayContext が必要な場合は、Visual.get-display-context を呼び出すことによりフェッチしてください。

画面上のウィンドウまたは印刷されたページで表示可能なすべてのグラフィック階層は、そのルートにおいて、display-context オプションを DisplayContext オブジェクトに設定するオブジェクトを持つ必要があります。このオブジェクトは、グラフィック階層の表示に使用される表示媒体に適しています。つまり、オブジェクトは、display-context オプションの値が null から非 null DisplayContext オブジェクトに変更されるのをモニタリングすることにより、表示不可能なグラフィック階層に連結されていることを認識します。したがって、特定の動作を実行する必要のある Visual のサブクラスは、表示不可能なグラフィック階層に接続された場合、次のようなオプション宣言を含むことにより display-context オプションをモニタリングします。

{nonlocal-option public display-context:#DisplayContext
change handler}


ここで、change handler 内のコードは display-context オプションの現在値 (変数 display-context の値として、変更ハンドラ内にある) を取得し、null および非 null の値の間で行われる変更をモニタリングし、必要とされる動作を実行します。

ただし、このプログラミング熟語を使用するプログラマーは、グラフィカル表示を再配列する際、グラフィック階層からグラフィカル オブジェクトを一時的に分離し、これらを同じ階層に再アタッチすることが、割に一般的であることを理解するべきです。この処理により、一時的に分離されたオブジェクトは、display-context オブジェクトが null になり、再び非 null になるのを観察します。display-context オプションでの変更をモニタリングするコードは、この可能性を考慮に入れ、この状況における望ましくない動作の実行を回避しなくてはなりません。


font-family (非ローカル オプション)
public Chart.font-family:String

テキストのフォント書体を設定します。

説明

テキストをレンダリングするフォントの検索に使用するフォント ファミリー名 (または名前のリスト) を指定します。
フォントの指定方法の詳細については、Font を参照してください。

{VBox
    {text font-family = "serif", serif},
    {text font-family = "sans-serif", sans-serif},
    {text font-family = "monospace", monospace},
    {text
        font-family = "Arial, Nimbus Sans L, sans-serif",
        prefer a particular sans-serif
    },
    {text
        font-family =
            "Times New Roman, Nimbus Roman No9 L, serif",
        prefer a particular serif
    }
}


font-size (非ローカル オプション)
public Chart.font-size:any

オブジェクト内のテキストの既定サイズを指定します。

説明

このサイズは、数量の尺度単位である Distance で表されます。数量は他に、重量、温度、および他のカテゴリの測定単位をサポートします。

Distance 単位の例としては、pt (ポイント)、in (インチ)、cm (センチメートル) などがあります。サポートされる Distance 単位の詳細なリストについては、「数量と単位」の章を参照してください。

数量を指定するときは、数と単位の間にスペースを入れないでください。8pt4mm は、2 つの正しい font-size 値の例です。

font-size オプションを使用したテキスト サイズの指定方法の例をいくつか示します。"Medium" という語を持つテキスト オブジェクトが、それを含むテキスト オブジェクトから、どのようにフォント サイズを取得するかに注意してください。


{text font-size=12pt,
    {text font-size=8pt, Little}
    {text font-size=1cm, Pretty big}
    {text Medium}
    {text font-size=1in, Huge!}
}
{text And this is the default}

参照:

文字書式: tiny, small, big, huge


font-style (非ローカル オプション)
public Chart.font-style:FontStyle

オブジェクト内のテキストを斜体や斜投影法などのフォントにするかどうかを指定します。

説明

適切な値は次のとおりです。

このオプションは、非ローカル オプション ControlFrame.control-appearance-changeable? がコントロール上で true の場合、コントロール内のテキストの外観に反映されます。DialogMenuPane MenuBarDialog.use-look-and-feel? が true の場合、フォント書体は外観で指定された値に設定されるため、ダイアログやメニューで値を設定しても効果はありません。


{paragraph font-style="italic", Everything in this paragraph
    should be in an italic font,
    {text font-style="normal", except for this text fragment.}
}

参照:

文字書式: italic


font-weight (非ローカル オプション)
public Chart.font-weight:FontWeight

オブジェクト内のテキストを、太字として強調表示するかどうかを指定します。

説明

適切な値は次のとおりです。

このオプションは、非ローカル オプション ControlFrame.control-appearance-changeable? がコントロール上で true の場合、コントロール内のテキストの外観に反映されます。DialogMenuPane MenuBarDialog.use-look-and-feel? が true の場合、フォント スタイルは外観で指定された値に設定されるため、ダイアログやメニューで値を設定しても効果はありません。


{paragraph Everything in this paragraph
    should be normally weighted,
    {text font-weight="bold", except for this text fragment.}
}

参照:

文字書式: bold


height (フィールド)
public-get private-set Chart.height:Distance =-1m

グラフの現在の高さ。

説明

正数の場合、この測定にすべての要素が含まれますが、厳密な制約ではありません。(場合によっては、軸ラベルや目盛りラベルなどの要素がこの寸法を超えて拡張する場合があります。)
具体的には、この測定には Chart.plot-area-boundsChart.top-margin、および Chart.bottom-margin が含まれます。
この値は、Chart.set-chart-size を使用することによって、あるいはコンストラクタ Chart.default によって制御されます。Chart は、そのコンテナのサイズへの適合をサポートします。Chart.set-chart-size を参照してください。


layout-scheduled? (アクセサ)
アクセサ public final Chart.layout-scheduled?:bool

この Chart でレイアウト操作が保留中であるかどうかを示します。

説明

レイアウトは、Chart.invalidate-layout を使用してスケジュールし、Chart.ensure-layout-valid を使用してトリガできます。そうしない場合は、レイアウトは、保留中の Event が扱われると、直ちに処理されます。


left-margin (ローカル オプション)
public Chart.left-margin:any =null

Chart の左の余白に割り当てられたスペースの量。

説明

レイアウト操作および余白の役割については、Chart.width および Chart.plot-area-bounds を参照してください。このオプションとグラフの内容に基づいて実際の結果を計算する、Chart.get-actual-left-margin も参照してください。
有効な値の型は次のとおりです。
既定値は null で、Chart に、非プロット要素を格納する必要余白を見積もり、その値を使用するように指示します。
有効な値の例としては次のものがあります。
  • 2cm
  • 1.5in
  • 36pt
  • 3px
  • 36 (これは 36pt と同じです)
値をピクセルに換算して数量化する方法については、Shape.quantize-line-thickness を参照してください。


{import * from CURL.GUI.CHARTS}
{import * from CHARTS-DOC,
    location = "../docstring-support/gui/charts-doc.scurl"
}

{RecordGrid height = 6cm, record-source = sample-records}

{let chart:LayeredChart =
    {LayeredChart
        width = 15cm,
        height = 6cm,
        left-axis = {new {NumericAxis-of double}, 0, 70},
        right-axis = {ChartAxis {ChartDataSeries sample-records, "Height"}},
        {LineLayer
            {ChartDataSeries sample-records, "Age"},
            {ChartDataSeries sample-records, "Wins"},
            {ChartDataSeries sample-records, "Height"},
            x-axis-data = {ChartDataSeries sample-records, "Name"}
        }
    }
}


{let left:TextField =
    {TextField
        value = "null",
        {on ValueFinished at tf:TextField do
            let val:String = tf.value
            set chart.left-margin = {evaluate val}
        }
    }
}

{let right:TextField =
    {TextField
        value = "null",
        {on ValueFinished at tf:TextField do
            let val:String = tf.value
            set chart.right-margin = {evaluate val}
        }
    }
}

{let top:TextField =
    {TextField
        value = "null",
        {on ValueFinished at tf:TextField do
            let val:String = tf.value
            set chart.top-margin = {evaluate val}
        }
    }
}

{let bottom:TextField =
    {TextField
        value = "null",
        {on ValueFinished at tf:TextField do
            let val:String = tf.value
            set chart.bottom-margin = {evaluate val}
        }
    }
}

{Canvas
    width = chart.width,
    height = chart.height,
    chart
}
{Fill width = 1cm}
{VBox
    spacing = .25cm,
    "Margins:",
    {Table
        cell-border-width = 1pt,
        cell-border-color = "silver",
        cell-border-style = "sunken",
        border-width = 1pt,
        border-color="silver",
        border-style = "sunken",
        {column-prototype
            {bold side},
            "left",
            "right",
            "top",
            "bottom"
        },
        {column-prototype
            width = 3cm,
            {bold value},
            left,
            right,
            top,
            bottom
        }
    }
}


legend-alignment (アクセサ)
アクセサ public Chart.legend-alignment:double
セッター public Chart.legend-alignment:double

Chart.legend-location で選択されたグラフの辺に沿った凡例の配置。

説明

この値は、0.0 から 1.0 の範囲にある必要があります。


{import * from CURL.GUI.CHARTS}
{import * from CHARTS-DOC,
    location = "../docstring-support/gui/charts-doc.scurl"
}

{RecordGrid height = 6cm, record-source = sample-records}

{let chart:LayeredChart =
    {LayeredChart
        width = 15cm,
        height = 6cm,
        left-axis = {new {NumericAxis-of double}, 0, 70},
        right-axis = {ChartAxis {ChartDataSeries sample-records, "Height"}},
        {LineLayer
            {ChartDataSeries sample-records, "Age"},
            {ChartDataSeries sample-records, "Wins"},
            {ChartDataSeries sample-records, "Height"},
            x-axis-data = {ChartDataSeries sample-records, "Name"}
        }
    }
}


{Canvas
    width = chart.width,
    height = chart.height,
    chart
}

Legend location:
{DropdownList
    LegendLocation.left,
    LegendLocation.right,
    LegendLocation.top,
    LegendLocation.bottom,
    list-item-creation-proc =
        {proc {val:any}:ListItem
            {return
                {ListValueItem
                    value = val,
                    (val asa LegendLocation).name
                }
            }
        },
    {on ValueChanged at ddl:DropdownList do
        set chart.legend-location = ddl.value asa LegendLocation
    },
    value = LegendLocation.right
}

Legend alignment:
{TextField
    value = {format "%.2f", chart.legend-alignment},
    {on ValueFinished at tf:TextField do
        set chart.legend-alignment = {tf.value.to-double}
    }
}


legend-enabled? (非ローカル オプション)
public Chart.legend-enabled?:bool

Chart の凡例作成を有効または無効にするために使用できる bool

説明

legend-enabled? を参照してください。


legend-entry-factory (非ローカル オプション)
public Chart.legend-entry-factory:LegendEntryFactory

Chart の凡例の個別の凡例項目を生成するために使用されるファクトリ プロシージャ。

説明

legend-entry-factory を参照してください。


legend-factory (ローカル オプション)
public Chart.legend-factory:Chart.LegendFactory =Chart.default-legend-factory

Chart の凡例を表す Graphic の生成のためのファクトリ。

説明

このオプションを設定することは、凡例のトップレベルの外観を変更する最も簡単な方法です。既定でのこの実行方法の詳細については、Chart.default-legend-factory を参照してください。legend-entry-factory を使用して、凡例項目の外観を変更したい場合もあります。
プロシージャのパラメータについては、Chart.LegendFactory を参照してください。

このコードは、Chart.legend-factorylegend-entry-factory の両方を使用して、水平方向の凡例を作成する方法を示しています。この凡例は、データ系列の色を表示するためにテキストの色を使用します。

{import * from CURL.GUI.CHARTS}
{import * from CHARTS-DOC,
    location = "../docstring-support/gui/charts-doc.scurl"
}

{RecordGrid height = 6cm, record-source = sample-records}

{let chart:LayeredChart =
    {LayeredChart
        width = 15cm,
        height = 6cm,
        left-axis = {new {NumericAxis-of double}, 0, 70},
        right-axis = {ChartAxis {ChartDataSeries sample-records, "Height"}},
        legend-location = LegendLocation.top,
        legend-alignment = 0.5,
        legend-entry-factory =
            {proc
                {chart:Chart,
                 data-series:ChartDataSeries,
                 record:#Record,
                 color:FillPattern,
                 legend-index:int
                }:Graphic
                {return
                    {Frame
                        color = color,
                        {if-non-null record then
                            {data-series.field.domain.format
                                record[data-series.field.name]
                            }
                         else
                            data-series.field.caption
                        }
                    }
                }
            },
        legend-factory =
            {proc {chart:Chart, include-scrollbox?:bool}:#Graphic
                let constant entries:{Array-of Graphic} =
                    {chart.get-legend-entries}
                {if entries.empty? then
                    {return null}
                }
                
                let box:Box =
                    {HBox
                        margin = 4pt,
                        spacing = 8pt
                    }
                {for g in entries do {box.add g}}

                {return
                    {if include-scrollbox? then
                        {ScrollBox
                            border-width = 1px,
                            border-color = FillPattern.black,
                            box
                        }
                     else
                        set box.border-width = 1px
                        set box.border-color = FillPattern.black
                        {return box}
                    }
                }
            },
        {LineLayer
            {ChartDataSeries sample-records, "Age"},
            {ChartDataSeries sample-records, "Wins"},
            {ChartDataSeries sample-records, "Height"},