원통 이미지 차트
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
중요: Google Chart Tools의 이미지 차트 부분은 2012년 4월 20일부로 공식적으로 지원 중단되었습니다. Google의 지원 중단 정책에 따라 계속 사용할 수 있습니다.
개요
Google 차트 API를 사용하여 이미지로 렌더링되는 원통형 차트
원통형 차트는 총 분산 위에 시가 및 종가를 오버레이하는 데 사용됩니다. 원통형 차트는 주가 행동을 보여주는 데 자주 사용됩니다. 이 차트에서 시가가 종가보다 적은 항목은 녹색으로, 시가가 종가보다 큰 항목은 빨간색으로 그려집니다. 자세한 내용은 Google Charts API의 원통형 문서를 참고하세요.
예
<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load("current", {packages:["imagechart"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var options = {};
dataTable = google.visualization.arrayToDataTable([
['Gainers',10,30,45,60],
['Losers',20,35,25,45],
], true);
var chart = new google.visualization.ImageCandlestickChart(document.getElementById('chart_div'));
chart.draw(dataTable, options);
}
</script>
</head>
<body>
<div id="chart_div" style="width: 400px; height: 240px;"></div>
</body>
</html>
로드
google.charts.load
패키지 이름은 "imagechart"
입니다.
google.charts.load('current', {packages: [imagechart]});
시각화의 클래스 이름은 google.visualization.ImageCandlestickChart
입니다.
var visualization = new google.visualization.ImageCandlestickChart(container);
각 행이 하나의 원통형 마커를 설명하는 5개의 열:
- Col 0: X축에서 이 마커의 라벨로 사용되는 문자열입니다.
- Col 1: 이 마커의 낮은 값 또는 최솟값을 지정하는 숫자입니다. 검은색 선의 밑바닥입니다.
- Col 2: 이 마커의 시작 값/초기 값을 지정하는 숫자입니다. 원통의 한쪽 세로 테두리가 됩니다. 열 3의 값보다 작은 경우 녹색 원통이 표시되고 그렇지 않으면 빨간색이 표시됩니다.
- Col 3: 이 마커의 종가 또는 최종 값을 지정하는 숫자입니다. 이 값은 원통의 두 번째 세로 테두리입니다. 열 2의 값보다 작은 경우 원통이 빨간색으로 표시되고 그렇지 않으면 녹색으로 표시됩니다.
- Col 4: 이 마커의 높은 값 또는 최댓값을 지정하는 숫자입니다. 검은색 선의 상단입니다.
구성 옵션
원통형 차트는 일반 이미지 차트에서 지원하는 옵션 외에도 다음 옵션을 지원합니다.
이름 |
유형 |
기본값 |
설명 |
backgroundColor |
문자열 |
'#FFFFFF' (흰색) |
차트의 배경 색상입니다. 이는 #기호를 포함한 # RRGGBB 문자열입니다. |
showAxisLines |
boolean |
true |
축 선을 표시할지 선택합니다. false로 설정하면 축 라벨도 표시되지 않습니다. |
키 |
숫자 |
포함하는 요소의 높이 |
차트의 높이입니다(단위: 픽셀). 30 < 높이 또는 높이 > 1,000인 경우 이 값은 기본적으로 200으로 설정됩니다. |
max |
숫자 |
최대 데이터 값 |
최대 Y축 값입니다. |
분 |
숫자 |
최소 데이터 값 |
최소 Y축 값입니다. |
showCategoryLabels |
boolean |
true |
false인 경우 X축 라벨을 숨깁니다. |
showValueLabels |
boolean |
true |
false인 경우 Y축 라벨을 숨깁니다. |
showValueLabelsInternal |
숫자 |
자동 |
Y축 라벨 사이의 간격(픽셀)입니다. |
title |
문자열 |
'' |
차트 위에 표시할 텍스트입니다. |
너비 |
숫자 |
포함하는 요소의 너비 |
차트의 너비입니다(단위: 픽셀). width가 30보다 작거나 1,000보다 크면 width는 300으로 설정됩니다. |
메서드
메서드 |
반환 유형 |
설명 |
draw(data, options) |
없음 |
차트를 그립니다. |
이벤트
등록하면 일반 이미지 차트 페이지에 설명된 이벤트를 들을 수 있습니다.
데이터 정책
Chart API 로깅 정책을 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-07-10(UTC)
[null,null,["최종 업데이트: 2024-07-10(UTC)"],[],[],null,["# Candlestick Image Chart\n\n**Important:** The Image Charts portion of Google Chart Tools has been [officially deprecated](http://googledevelopers.blogspot.com/2012/04/changes-to-deprecation-policies-and-api.html) as of April 20, 2012. It will continue to work as per our [deprecation policy](/chart/terms). \n1. [Overview](#Overview)\n2. [Example](#Example)\n3. [Loading](#Loading)\n4. [Data Format](#Data_Format)\n5. [Configuration Options](#Configuration_Options)\n6. [Methods](#Methods)\n7. [Events](#Events)\n8. [Data Policy](#Data_Policy)\n\nOverview\n--------\n\n\nA candlestick chart that is rendered as an image using the [Google Charts API](/chart/image/docs/gallery/compound_charts#candlestick_charts).\n\nA candlestick chart is used to show an opening and closing value overlaid on top of a total variance. Candlestick charts are often used to show stock value behavior. In this chart, items where the opening value is less than the closing value are drawn in green, and items where the opening value is more than the closing value are drawn in red. See the [candlestick documentation in the Google Charts API](/chart/image/docs/gallery/compound_charts#candlestick_charts) for more information.\n\nExample\n-------\n\n\u003cbr /\u003e\n\n\\\u003cscript type=\"text/javascript\" src=\"https://www.gstatic.com/charts/loader.js\"\\\u003e\\\u003c/script\\\u003e \\\u003cscript type=\"text/javascript\"\\\u003e google.charts.load('current', {'packages':\\['imagechart'\\]}); \\\u003c/script\\\u003e \\\u003cdiv id=\"chart_div\" style=\"width: 400px; height: 240px;\"\\\u003e\\\u003c/div\\\u003e google.charts.setOnLoadCallback(drawChart); function drawChart() { var options = {}; dataTable = google.visualization.arrayToDataTable(\\[ \\['Gainers',10,30,45,60\\], \\['Losers',20,35,25,45\\], \\], true); var chart = new google.visualization.ImageCandlestickChart(document.getElementById('chart_div')); chart.draw(dataTable, options); } \n\n```html\n\u003chtml\u003e\n \u003chead\u003e\n \u003cscript type=\"text/javascript\" src=\"https://www.gstatic.com/charts/loader.js\"\u003e\u003c/script\u003e\n \u003cscript type=\"text/javascript\"\u003e\n google.charts.load(\"current\", {packages:[\"imagechart\"]});\n google.charts.setOnLoadCallback(drawChart);\n\n function drawChart() {\n\n var options = {};\n dataTable = google.visualization.arrayToDataTable([\n ['Gainers',10,30,45,60],\n ['Losers',20,35,25,45],\n ], true);\n\n var chart = new google.visualization.ImageCandlestickChart(document.getElementById('chart_div'));\n chart.draw(dataTable, options);\n }\n \u003c/script\u003e\n \u003c/head\u003e\n \u003cbody\u003e\n \u003cdiv id=\"chart_div\" style=\"width: 400px; height: 240px;\"\u003e\u003c/div\u003e\n \u003c/body\u003e\n\u003c/html\u003e\n```\n\nLoading\n-------\n\n\nThe `google.charts.load` package name is `\"imagechart\"`. \n\n```transact-sql\n google.charts.load('current', {packages: [imagechart]});\n```\n\n\nThe visualization's class name is `google.visualization.`ImageCandlestickChart. \n\n```gdscript\n var visualization = new google.visualization.ImageCandlestickChart(container);\n```\n\nData Format\n-----------\n\nFive columns, where each row describes a single candlestick marker:\n\n- **Col 0:** String used as a label for this marker on the X axis.\n- **Col 1:** Number specifying the low/minimum value of this marker. This is the base of the black line.\n- **Col 2:** Number specifying the opening/initial value of this marker. This is one vertical border of the candle. If less than the column 3 value, the candle will be green; otherwise it will be red.\n- **Col 3:** Number specifying the closing/final value of this marker. This is the second vertical border of the candle. If less than the column 2 value, the candle will be red; otherwise it will be green.\n- **Col 4:** Number specifying the high/maximum value of this marker. This is the top of the black line.\n\nConfiguration Options\n---------------------\n\nIn addition to the options supported by the [Generic Image Chart](/chart/interactive/docs/gallery/genericimagechart#Configuration_Options),\nthe Candlestick Chart supports the following options:\n\n| Name | Type | Default | Description |\n|-------------------------|---------|----------------------------------|-------------------------------------------------------------------------------------------------------------------|\n| backgroundColor | string | '#FFFFFF' (white) | The background color for the chart. This is a #RRGGBB string, including the # mark. |\n| showAxisLines | boolean | true | Whether to show the axis lines. If set to false, then the axis labels will also not be shown. |\n| height | number | Height of the containing element | Height of the chart, in pixels. If 30 \\\u003c *height* or *height* \\\u003e 1,000 then this value will default to 200. |\n| max | number | Maximum data value | The maximum Y axis value. |\n| min | number | Minimum data value | The minimum Y axis value. |\n| showCategoryLabels | boolean | true | If false, hides the X axis labels. |\n| showValueLabels | boolean | true | If false, hides the Y axis labels. |\n| showValueLabelsInternal | number | auto | The spacing between the Y axis labels, in pixels. |\n| title | string | '' | Text to display above the chart. |\n| width | number | Width of the containing element | Width of the chart, in pixels. If *width* is less than 30 or greater than 1,000, then *width* will be set to 300. |\n\nMethods\n-------\n\n| Method | Return Type | Description |\n|-----------------------|-------------|------------------|\n| `draw(data, options)` | none | Draws the chart. |\n\nEvents\n------\n\nYou can register to hear the events described on the [Generic\nImage Chart](/chart/interactive/docs/gallery/genericimagechart#Events) page.\n\nData Policy\n-----------\n\n\nPlease refer to the [Chart API logging policy](/chart/interactive/faq#logging)."]]