線を使用してデータ系列をプロットする
説明
注意事項
例
例 | |
{import * from CURL.GUI.CHARTS} {import * from CHARTS-DOC, location = "../docstring-support/gui/charts-doc.scurl" } {let chart:LayeredChart = {LayeredChart width = 15cm, height = 6cm, {LineLayer sample-records, "Age", "Points", x-axis-data = {ChartDataSeries sample-records, "Name"}, stroke-thickness = 3pt, shape-factory = {proc {layer:LineLayer, points:{FastArray-of PointRecordPair}, series-index:int }:Shape let constant stock-shape:Shape = {LineLayer.default-shape-factory layer, points, series-index } let constant fill-pattern:FillPattern = {layer.get-fill-pattern-for-data-series series-index} {for point in points do {stock-shape.add {RectangleShape {GRect 3pt, 3pt, 3pt, 3pt}, translation = point.point, rotation = 45deg, color = {darker-fill-pattern fill-pattern}, border-width = 1.5pt, border-color = FillPattern.silver, tooltip = {Tooltip style = TooltipStyle.immediate, {value def fname = layer.y-axis-data[series-index].field.name {format "%s: %s = %g", point.record["Name"], fname, point.record[fname] } } } } } } {return stock-shape} } } } } {AntialiasedFrame chart} |
新規の LineLayer を作成します。 |
この LineLayer のプロットを表す |
この LineLayer 内の各プロット |
オプションで、各データ ポイントにシンボルを表示します。 |
LineLayer |
この ChartLayer の内部レイアウトを更新します。 |
新規の LineLayer を作成します。
例
この LineLayer のプロットを表す
説明
この LineLayer 内の各プロット
説明
例
例 | |
{import * from CURL.GUI.CHARTS} {import * from CHARTS-DOC, location = "../docstring-support/gui/charts-doc.scurl" } {let chart:LayeredChart = {LayeredChart width = 15cm, height = 6cm, legend-location = "right", {LineLayer sample-records, "Age", "Points", x-axis-data = {ChartDataSeries sample-records, "Name"}, shape-factory = {proc {layer:LineLayer, points:{FastArray-of PointRecordPair}, series-index:int }:Shape let constant fill-pattern:FillPattern = {layer.get-fill-pattern-for-data-series series-index} let constant group:ShapeGroup = {ShapeGroup arrow-body-width = 2px, arrow-head-width = 8px, arrow-head-length = 12px, arrow-head-style = ArrowStyle.solid, arrow-tail-style = ArrowStyle.none, font-size = 8pt } {for point key idx in points do {if idx < points.size - 1 then {group.add {ArrowShape point.point, points[idx + 1].point, color = fill-pattern, {EllipseShape {GRect 5pt, 5pt, 5pt, 5pt}, translation = point.point, color = {lighter-fill-pattern fill-pattern}, {TextShape {value def fname = layer.y-axis-data[series-index].field.name {format "%.2g", point.record[fname]} }, color = FillPattern.black, valign = "center" } } } } } } {return group} } } } } {AntialiasedFrame chart} |
オプションで、各データ ポイントにシンボルを表示します。
説明
例
例: LineLayer.symbols-at-data-points? の使用 | |
{import * from CURL.GUI.CHARTS} {import * from CHARTS-DOC, location = "../docstring-support/gui/charts-doc.scurl" } {let chart:LayeredChart = {LayeredChart width = 12cm, height = 8cm, {LineLayer sample-records, "Age", "Points", x-axis-data = {ChartDataSeries sample-records, "Name"}, symbols-at-data-points? = true } } } {value chart} {CheckButton label = "symbols-at-data-points?", value = true, {on ValueFinished at cb:CheckButton do let layer:LineLayer = chart.layers[0] asa LineLayer set layer.symbols-at-data-points? = cb.value } } |
LineLayer
戻り値
説明
戻り値
説明
説明
説明
例
例: ChartLayer.set-data-series-visibility の使用 | |
{import * from CURL.GUI.CHARTS} {import * from CHARTS-DOC, location = "../docstring-support/gui/charts-doc.scurl" } {let chart:LayeredChart = {LayeredChart width = 12cm, height = 6cm, {LineLayer sample-records, "Age", "Points", "Height", x-axis-data = {ChartDataSeries sample-records, "Name"}, symbols-at-data-points? = true } } } {value chart} {CheckButton label = "Show Age?", value = true, {on ValueFinished at cb:CheckButton do let layer:ChartLayer = chart.layers[0] {layer.set-data-series-visibility 0, cb.value} } } {CheckButton label = "Show Points?", value = true, {on ValueFinished at cb:CheckButton do let layer:ChartLayer = chart.layers[0] {layer.set-data-series-visibility 1, cb.value} } } {CheckButton label = "Show Height?", value = true, {on ValueFinished at cb:CheckButton do let layer:ChartLayer = chart.layers[0] {layer.set-data-series-visibility 2, cb.value} } } |
この ChartLayer の内部レイアウトを更新します。
説明