説明
注意事項
軸位置 ( | 推奨する halign (または horigin) | 推奨する valign (または vorigin) |
AxisPosition.left | "right" | "center" |
AxisPosition.right | "left" | "center" |
AxisPosition.top | "center" | "bottom" |
AxisPosition.bottom | "center" | "top" |
例
例: 目盛りラベル ファクトリの使用 | |
{import * from CURL.GUI.CHARTS} {import * from CHARTS-DOC, location = "../docstring-support/gui/charts-doc.scurl" } {let chart:LayeredChart = {LayeredChart width = 15cm, height = 7cm, bottom-axis-parent = {ShapeGroup || Override for just the bottom axis: tick-label-rotation = 0deg, tick-label-auto-stagger? = false, tick-label-factory = {proc {axis:ChartAxis, tick:ChartTick, tick-rotation:Angle}:any {if tick.value == null then {return null} } let (halign:String, valign:String) = {axis.get-tick-label-alignment tick-rotation} let shape:TextShape = {TextShape || Put the origin at the left edge of the || shape for rotation. halign = halign, valign = valign, color = "black", {format "%s", tick.value} } let bounds:GRect = {shape.get-own-bounds} {bounds.grow 3pt} {return {RectangleShape bounds, color = "lightsteelblue", border-color = "steelblue", border-width = 1px, rotation = tick-rotation, shape } } {return shape} } }, {LineLayer sample-records, "Age", "Points", x-axis-data = {ChartDataSeries sample-records, "Name"} } } } {AntialiasedFrame chart} {text tick-label-rotation (on bottom axis only):} {TextField value = "0deg", width = 3cm, {on ValueFinished at tf:TextField do set chart.bottom-axis-parent.tick-label-rotation = {evaluate tf.value} asa Angle } } |