RcLegend
Extends
์ฐจํธ ๋ฒ๋ก ๋ชจ๋ธ.
Config Properties
Name | Type | Description |
---|---|---|
align | 'center'|'left'|'right' | ์ํ ๋ฐฐ์น. |
alignBase | 'body'|'chart'|'parent' | legend ์ ๋ ฌ ๊ธฐ์ค. |
backgroundStyle | SVGStyles | string | ๋ฐฐ๊ฒฝ ์คํ์ผ ์ . |
gap | number | location ์ด 'body'๊ฐ ์๋ ๋, legend view์ ๋๋จธ์ง chart ์์ญ ์ฌ์ด์ gap. |
itemGap | number | legend ์์ดํ ๋ค ์ฌ์ด์ ๊ฐ๊ฒฉ. |
itemsAlign | 'center'|'end'|'start' | ํ ๋ผ์ธ์ item๋ค์ด ๋ฐฐ์น๋๋ ์์น. |
itemsPerLine | number | ํ ์ค ๋น ํ์ํ ์ต๋ legend ํญ๋ชฉ ์. |
layout | 'auto'|'horizontal'|'vertical' | item ๋ฐฐ์น ๋ฐฉํฅ. |
lineGap | number | ๋ผ์ธ ์ฌ์ด์ ๊ฐ๊ฒฉ. |
location | 'body'|'bottom'|'left'|'right'|'top' | ํ์ ์์น. |
markerGap | number | marker์ text์ฌ์ด์ ๊ฐ๊ฒฉ. |
markerSize | number | marker ํฌ๊ธฐ. |
markerVisible | boolean | marker ํ์ ์ฌ๋ถ. |
maxHeight | string | number | ์์ง ๋ฐฐ์น ์ผ ๋, ์ต๋ ๋์ด๋ฅผ ํฝ์ ๋จ์์ ํฌ๊ธฐ ํน์ body ๋์ด์ ๋ํ ์๋ ๊ธธ์ด๋ฅผ '%'๋ก ์ง์ ํ๋ค. |
maxWidth | string | number | ์ํ ๋ฐฐ์น ์ผ ๋, ์ต๋ ๋๋น๋ฅผ ํฝ์ ๋จ์์ ํฌ๊ธฐ ํน์ body ๋๋น์ ๋ํ ์๋ ๊ธธ์ด๋ฅผ '%'๋ก ์ง์ ํ๋ค. |
offsetX | number | ๋ฒ๋ก์ body ํน์ ์ฐจํธ ๊ฒฝ๊ณ ์ฌ์ด์ ์ํ ๊ฐ๊ฒฉ. |
offsetY | number | ๋ฒ๋ก์ body ํน์ ์ฐจํธ ๊ฒฝ๊ณ ์ฌ์ด์ ์์ง ๊ฐ๊ฒฉ. |
seriesHovering | boolean | ์๋ฆฌ์ฆ๊ฐ ์ฐ๊ฒฐ๋ ๋ฒ๋ก ์์ดํ ์ ๋ง์ฐ์ค๊ฐ ์ฌ๋ผ๊ฐ๋ฉด ๋๋จธ์ง ์๋ฆฌ์ฆ๋ค์ ๋ฐํฌ๋ช ์ฒ๋ฆฌํด์ ์ฐ๊ฒฐ๋ ์๋ฆฌ์ฆ๋ฅผ ๊ฐ์กฐํ๋ค. |
style | SVGStyles | string | ์คํ์ผ์ ํน์ class selector. |
useTextColor | boolean | ๋ฒ๋ก ํญ๋ชฉ์ ํ ์คํธ์๋ marker์ ๋์ผํ ์์์ ์ ์ฉํ๋ค. |
verticalAlign | 'bottom'|'middle'|'top' | ์์ง ๋ฐฐ์น. |
visible | boolean | ํ์ ์ฌ๋ถ. |
Methods
get(prop): any (opens in a new tab)
์ง์ ํ ์ค์ ๊ฐ(๋ค)์ ๊ฐ์ ธ์จ๋ค.
์ง์ ๊ฐ๋ฅํ ์ค์ ๊ฐ ๋ชฉ๋ก์ Configuration API ํ์ด์ง์์ ํ์ธํ ์ ์๋ค.
Utils.log(chart.series.get('name'))
ํ์ ๊ฐ์ฒด์ ์ค์ ์์ฑ์ ์์ฑ ๊ฒฝ๋ก๋ฅผ ์ง์ ํด์ ์ง์ ๊ฐ์ ธ์ฌ ์๋ ์๋ค.
Utils.log(chart.axis.get('title.text'));
์์ฑ ๋ณ๊ฒฝ์ set, setAll, toggle๋ฑ์ผ๋ก ์คํํ๋ค.
Parameter | Type | Description |
---|---|---|
prop | string (opens in a new tab) | '.'์ผ๋ก ๊ตฌ๋ถ๋๋ ์์ฑ ๊ฒฝ๋ก. |
set(prop, value, redraw): RcChartObject
์ง์ ํ ์์ฑ์ ๊ฐ(๋ค)์ ์ค์ ํ๋ค.
์ง์ ๊ฐ๋ฅํ ์ค์ ๊ฐ ๋ชฉ๋ก์ Configuration API ํ์ด์ง์์ ํ์ธํ ์ ์๋ค.
๋, ์ด ๊ฐ์ฒด ์์ ์ ๋ฆฌํดํ๋ฏ๋ก javascript์์ builder ํจํด์ผ๋ก ์ค์ ๊ฐ๋ค์ ์ฐ์ํด์ ์ง์ ํ ์ ์๋ค.
chart.series.set('xAxis', 1).set('yAxis', 1);
get์์์ ๋ง์ฐฌ๊ฐ์ง๋ก ํ์ ๊ฐ์ฒด์ ์ค์ ์์ฑ์ ์์ฑ ๊ฒฝ๋ก๋ฅผ ํตํด ์ง์ ์ค์ ํ ์๋ ์๋ค.
chart.axis.set('title.text', 'New Title'));
Parameter | Type | Description |
---|---|---|
prop | string (opens in a new tab) | ์ค์ ์์ฑ ๊ฒฝ๋ก ๋ฌธ์์ด |
value | any (opens in a new tab) | ์ง์ ํ ๊ฐ(๋ค) |
redraw=true | boolean (opens in a new tab) | true๋ก ์ง์ ํ๋ฉด chart๋ฅผ ๋ค์ ๊ทธ๋ฆฐ๋ค. false๋ก ์ง์ ํ๊ณ ์ฌ๋ฌ ์ค์ ํ์ render๋ฅผ ํธ์ถํด์ ๋ค์ ๊ทธ๋ฆฌ๊ฒ ํ ์๋ ์๋ค. |
setAll(props, redraw): RcChartObject
JSON ๊ฐ์ฒด๋ก ์ง์ ํ ์์ฑ๋ค์ ๊ฐ์ ์ค์ ํ๋ค.
์ง์ ๊ฐ๋ฅํ ์ค์ ๊ฐ ๋ชฉ๋ก์ Configuration API ํ์ด์ง์์ ํ์ธํ ์ ์๋ค.
chart.series.set({
xAxis: 1,
yAxis: 1,
yField: 'salary'
});
Parameter | Type | Description |
---|---|---|
props | object (opens in a new tab) | ์ฌ๋ฌ ์ค์ ๊ฐ๋ค์ด ์ง์ ๋ JSON ๊ฐ์ฒด |
redraw=true | boolean (opens in a new tab) | true๋ก ์ง์ ํ๋ฉด chart๋ฅผ ๋ค์ ๊ทธ๋ฆฐ๋ค. false๋ก ์ง์ ํ๊ณ ์ฌ๋ฌ ์ค์ ํ์ render๋ฅผ ํธ์ถํด์ ๋ค์ ๊ทธ๋ฆฌ๊ฒ ํ ์๋ ์๋ค. |
toggle(prop, redraw): RcChartObject
Boolean ํ์
์ ์ค์ ๊ฐ์ ๋ณ๊ฒฝํ๋ค.
์ง์ ๊ฐ๋ฅํ ์ค์ ๊ฐ ๋ชฉ๋ก์ Configuration API ํ์ด์ง์์ ํ์ธํ ์ ์๋ค.
chart.getSeries('ser02').toggle('visible');
Parameter | Type | Description |
---|---|---|
prop | string (opens in a new tab) | ์ค์ ์์ฑ ์ด๋ฆ |
redraw=true | boolean (opens in a new tab) | true๋ก ์ง์ ํ๋ฉด chart๋ฅผ ๋ค์ ๊ทธ๋ฆฐ๋ค. false๋ก ์ง์ ํ๊ณ ์ฌ๋ฌ ์ค์ ํ์ render๋ฅผ ํธ์ถํด์ ๋ค์ ๊ทธ๋ฆฌ๊ฒ ํ ์๋ ์๋ค. |