KLineChart/tests/index.html
2023-06-19 08:48:33 -05:00

125 lines
4.7 KiB
HTML

<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="keywords" content="kline time-line candlestick stock chart canvas k线 行情 蜡烛图 分时图 技术指标 图表"/>
<meta name="description" content="shape test"/>
<title>KLineChart test cases</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<style>
h1 {
padding-left: 0.7em
}
</style>
<h1>Test cases</h1>
<div id="case-list"></div>
<script>
window.onload = function () {
var cases = [
{
title: 'Styles',
children: [
{ title: 'Initialize settings, custom styles', link: './html/styles/1.html' },
{ title: 'Initialize settings, use built-in styles', link: './html/styles/2.html' },
{ title: 'Api settings, custom styles', link: './html/styles/3.html' },
{ title: 'Api settings, use built-in styles', link: './html/styles/4.html' },
{ title: 'Register styles', link: './html/styles/5.html' },
{ title: 'Tooltip', link: './html/styles/6.html' }
]
},
{
title: 'I18n',
children: [
{ title: 'Initialize settings', link: './html/i18n/1.html' },
{ title: 'Api settings', link: './html/i18n/2.html' },
{ title: 'Register locale', link: './html/i18n/3.html' }
]
},
{
title: 'Timezone',
children: [
{ title: 'Initialize settings', link: './html/timezone/1.html' },
{ title: 'Api settings', link: './html/timezone/2.html' }
]
},
{
title: 'Custom api',
children: [
{ title: 'Initialize settings', link: './html/custom-api/1.html' },
{ title: 'Api settings', link: './html/custom-api/2.html' }
]
},
{
title: 'Data',
children: [
{ title: 'Real time update', link: './html/data/1.html' },
{ title: 'Load more', link: './html/data/2.html' }
]
},
{
title: 'Indicator',
children: [
{ title: 'Use built-in indicators', link: './html/indicator/1.html' },
{ title: 'Indicator override', link: './html/indicator/2.html' },
{ title: 'Simple custom Indicator', link: './html/indicator/3.html' },
{ title: 'Custom Indicator, use custom draw', link: './html/indicator/4.html' }
]
},
{
title: 'Overlay',
children: [
{ title: 'Use built-in overlays', link: './html/overlay/1.html' },
{ title: 'Use built-in overlays, specify points', link: './html/overlay/2.html' },
{ title: 'Overlay override', link: './html/overlay/3.html' },
]
},
{
title: 'Figures',
children: [
{ title: 'Rect bounding', link: './html/figure/1.html' },
]
},
{ title: 'Set precision', link: './html/set-precision.html' },
{ title: 'Set bar width', link: './html/set-bar-width.html' },
{ title: 'Set pane options', link: './html/set-pane-options.html' }
]
var html = '<ul>'
cases.forEach(function (child) {
var childHtml = '<li>'
if (child.children) {
var grandsonHtml = '<p>' + child.title + '</p>' + '<ul>'
child.children.forEach(function (grandson) {
grandsonHtml += '<li>' + '<a target="_blank" href="' + grandson.link + '">' + grandson.title + '</a>' + '</li>'
})
grandsonHtml += '</ul>'
childHtml += grandsonHtml
} else {
childHtml += ('<a target="_blank" href="' + child.link + '">' + child.title + '</a>')
}
childHtml += '</li>'
html += childHtml
})
html += '</ul>'
document.getElementById('case-list').innerHTML = html
}
</script>
</body>
</html>