jmchart 1.1.81 → 1.1.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -28
- package/build.js +35 -35
- package/dist/jmchart.amd.js +682 -427
- package/dist/jmchart.cjs.js +680 -425
- package/dist/jmchart.esm.js +679 -424
- package/dist/jmchart.iife.js +681 -426
- package/dist/jmchart.system.js +684 -429
- package/example/bar.html +186 -180
- package/example/candlestick.html +288 -0
- package/example/index.html +294 -0
- package/example/js/vconsole.js +10 -0
- package/example/line.html +300 -297
- package/example/pie.html +353 -353
- package/example/stackBar.html +142 -142
- package/example/stackLine.html +147 -147
- package/example/test.html +93 -40
- package/example/vue.html +322 -322
- package/example/wk/line.html +314 -314
- package/index.js +8 -8
- package/package.json +42 -42
- package/rollup.config.js +26 -26
- package/server.js +48 -45
- package/src/common/style.js +259 -242
- package/src/common/tooltip.js +165 -165
- package/src/common/utils.js +21 -21
- package/src/component/vchart.js +130 -130
- package/src/core/axis/axis.js +622 -622
- package/src/core/legend/legend.js +163 -163
- package/src/core/markLine/manager.js +153 -0
- package/src/core/{axis → markLine}/markLine.js +190 -190
- package/src/jmChart.js +416 -464
- package/src/series/barSeries.js +135 -135
- package/src/series/candlestickSeries.js +114 -0
- package/src/series/lineSeries.js +243 -243
- package/src/series/pieSeries.js +350 -350
- package/src/series/series.js +397 -396
- package/src/series/stackBarSeries.js +144 -144
- package/src/series/stackLineSeries.js +145 -145
package/example/test.html
CHANGED
|
@@ -1,41 +1,94 @@
|
|
|
1
|
-
<!
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
|
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<!--<script type="text/javascript" src="../src/jmchart.debug.js" id="jmgraph" ></script>-->
|
|
7
|
+
|
|
8
|
+
<style>
|
|
9
|
+
html,body {
|
|
10
|
+
margin:0;
|
|
11
|
+
padding:10px;
|
|
12
|
+
width:100%;
|
|
13
|
+
height:100%;
|
|
14
|
+
}
|
|
15
|
+
#mycanvas canvas, #mycanvas div{
|
|
16
|
+
background-color:#fff;
|
|
17
|
+
margin:0 auto;
|
|
18
|
+
}
|
|
19
|
+
/*div.jm-tooltip {
|
|
20
|
+
background-color: rgba(255,255,255,0.8);
|
|
21
|
+
padding:4px;
|
|
22
|
+
border:1px solid #000;
|
|
23
|
+
box-shadow: 0 0 3px #000;
|
|
24
|
+
border-radius: 6px;
|
|
25
|
+
}*/
|
|
26
|
+
</style>
|
|
27
|
+
<script type="module">
|
|
28
|
+
//window.devicePixelRatio = 1;
|
|
29
|
+
import { jmChart } from '../dist/jmchart.esm.js';
|
|
30
|
+
|
|
31
|
+
(function load() {
|
|
32
|
+
var w = Math.max((window.innerWidth || window.document.body.clientWidth) * 0.9, 600);
|
|
33
|
+
var h = Math.max((window.innerHeight || window.document.body.clientHeight) * 0.6, 200);
|
|
34
|
+
inichart(w,h);
|
|
35
|
+
})();
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
function inichart(w, h) {
|
|
39
|
+
var chart = new jmChart('mycanvas', {
|
|
40
|
+
width: w,
|
|
41
|
+
height: h,
|
|
42
|
+
xField: 'date',
|
|
43
|
+
//baseY: 0,
|
|
44
|
+
enableAnimate: true,
|
|
45
|
+
autoRefresh: true,
|
|
46
|
+
|
|
47
|
+
style: {
|
|
48
|
+
margin: {
|
|
49
|
+
left: 50
|
|
50
|
+
},
|
|
51
|
+
legend: {
|
|
52
|
+
legendPosition: 'top'
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
//chart.legend.legendPosition = 'top';
|
|
57
|
+
chart.legend.visible = true;
|
|
58
|
+
|
|
59
|
+
// touch改变数据点事件
|
|
60
|
+
chart.on('touchPointChange', function(args) {
|
|
61
|
+
console.log(args);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
var line1 = chart.createSeries('line', {
|
|
65
|
+
field: 'nav',
|
|
66
|
+
//index: 2, // 指定Y轴索引,如是档指定就会共用左边的Y轴,
|
|
67
|
+
// 最大值和最小值,如果不指定会自动计算,
|
|
68
|
+
// 如果指定了也只是指定了最大或最小边界,如果有数值超过它,依然以事实数值为准
|
|
69
|
+
minYValue: 0.97,
|
|
70
|
+
maxYValue: 1.05,
|
|
71
|
+
style: {
|
|
72
|
+
// 画圆滑的曲线
|
|
73
|
+
curve: true,// 填充图形
|
|
74
|
+
label: {
|
|
75
|
+
show: true
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
chart.data = [ { "since_setup_rise_rate": "0", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "-", "adjusted_nav": 1, "nav": 1, "year1_rise_rate": "-", "date": "2022-06-27", "day7_rise_rate_year": "-", "accumulative_nav": 1, "per_ten_thousands_income": 0, "day1_rise_rate": "-" }, { "since_setup_rise_rate": "0.0025", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "-", "adjusted_nav": 1.0025, "nav": 1.0025, "year1_rise_rate": "-", "date": "2022-07-01", "day7_rise_rate_year": "0", "accumulative_nav": 1.0025, "per_ten_thousands_income": 0, "day1_rise_rate": "0.0025" }, { "since_setup_rise_rate": "0.0023", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "-", "adjusted_nav": 1.0023, "nav": 1.0023, "year1_rise_rate": "-", "date": "2022-07-08", "day7_rise_rate_year": "0", "accumulative_nav": 1.0023, "per_ten_thousands_income": 0, "day1_rise_rate": "-0.0002" }, { "since_setup_rise_rate": "0.0028", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "-", "adjusted_nav": 1.0028, "nav": 1.0028, "year1_rise_rate": "-", "date": "2022-07-15", "day7_rise_rate_year": "0", "accumulative_nav": 1.0028, "per_ten_thousands_income": 0, "day1_rise_rate": "0.000499" }, { "since_setup_rise_rate": "0.0057", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "-", "adjusted_nav": 1.0057, "nav": 1.0057, "year1_rise_rate": "-", "date": "2022-07-22", "day7_rise_rate_year": "0", "accumulative_nav": 1.0057, "per_ten_thousands_income": 0, "day1_rise_rate": "0.002892" }, { "since_setup_rise_rate": "0.0079", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "0.0079", "adjusted_nav": 1.0079, "nav": 1.0079, "year1_rise_rate": "-", "date": "2022-07-29", "day7_rise_rate_year": "0", "accumulative_nav": 1.0079, "per_ten_thousands_income": 0, "day1_rise_rate": "0.002188" }, { "since_setup_rise_rate": "0.0094", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "0.006883", "adjusted_nav": 1.0094, "nav": 1.0094, "year1_rise_rate": "-", "date": "2022-08-05", "day7_rise_rate_year": "0", "accumulative_nav": 1.0094, "per_ten_thousands_income": 0, "day1_rise_rate": "0.001488" }, { "since_setup_rise_rate": "0.0103", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "0.007982", "adjusted_nav": 1.0103, "nav": 1.0103, "year1_rise_rate": "-", "date": "2022-08-12", "day7_rise_rate_year": "0", "accumulative_nav": 1.0103, "per_ten_thousands_income": 0, "day1_rise_rate": "0.000892" }, { "since_setup_rise_rate": "0.0164", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "0.013562", "adjusted_nav": 1.0164, "nav": 1.0164, "year1_rise_rate": "-", "date": "2022-08-19", "day7_rise_rate_year": "0", "accumulative_nav": 1.0164, "per_ten_thousands_income": 0, "day1_rise_rate": "0.006038" }, { "since_setup_rise_rate": "0.0155", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "0.009744", "adjusted_nav": 1.0155, "nav": 1.0155, "year1_rise_rate": "-", "date": "2022-08-26", "day7_rise_rate_year": "0", "accumulative_nav": 1.0155, "per_ten_thousands_income": 0, "day1_rise_rate": "-0.000885" }, { "since_setup_rise_rate": "0.0168", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "0.00883", "adjusted_nav": 1.0168, "nav": 1.0168, "year1_rise_rate": "-", "date": "2022-09-02", "day7_rise_rate_year": "-", "accumulative_nav": 1.0168, "per_ten_thousands_income": 0, "day1_rise_rate": "0.00128" }, { "since_setup_rise_rate": "0.0193", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "0.009808", "adjusted_nav": 1.0193, "nav": 1.0193, "year1_rise_rate": "-", "date": "2022-09-09", "day7_rise_rate_year": "-", "accumulative_nav": 1.0193, "per_ten_thousands_income": 0, "day1_rise_rate": "0.002459" }, { "since_setup_rise_rate": "0.0256", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "0.015144", "adjusted_nav": 1.0256, "nav": 1.0256, "year1_rise_rate": "-", "date": "2022-09-16", "day7_rise_rate_year": "-", "accumulative_nav": 1.0256, "per_ten_thousands_income": 0, "day1_rise_rate": "0.006181" }, { "since_setup_rise_rate": "0.0287", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "0.012102", "adjusted_nav": 1.0287, "nav": 1.0287, "year1_rise_rate": "-", "date": "2022-09-23", "day7_rise_rate_year": "-", "accumulative_nav": 1.0287, "per_ten_thousands_income": 0, "day1_rise_rate": "0.003023" }, { "since_setup_rise_rate": "0.0287", "month6_rise_rate": "-", "month3_rise_rate": "0.0287", "month1_rise_rate": "0.012999", "adjusted_nav": 1.0287, "nav": 1.0287, "year1_rise_rate": "-", "date": "2022-09-30", "day7_rise_rate_year": "-", "accumulative_nav": 1.0287, "per_ten_thousands_income": 0, "day1_rise_rate": "0" }, { "since_setup_rise_rate": "0.0299", "month6_rise_rate": "-", "month3_rise_rate": "0.027537", "month1_rise_rate": "0.010399", "adjusted_nav": 1.0299, "nav": 1.0299, "year1_rise_rate": "-", "date": "2022-10-14", "day7_rise_rate_year": "-", "accumulative_nav": 1.0299, "per_ten_thousands_income": 0, "day1_rise_rate": "0.001167" }, { "since_setup_rise_rate": "0.0316", "month6_rise_rate": "-", "month3_rise_rate": "0.02872", "month1_rise_rate": "0.00585", "adjusted_nav": 1.0316, "nav": 1.0316, "year1_rise_rate": "-", "date": "2022-10-21", "day7_rise_rate_year": "-", "accumulative_nav": 1.0316, "per_ten_thousands_income": 0, "day1_rise_rate": "0.001651" }, { "since_setup_rise_rate": "0.0282", "month6_rise_rate": "-", "month3_rise_rate": "0.022372", "month1_rise_rate": "-0.000486", "adjusted_nav": 1.0282, "nav": 1.0282, "year1_rise_rate": "-", "date": "2022-10-28", "day7_rise_rate_year": "-", "accumulative_nav": 1.0282, "per_ten_thousands_income": 0, "day1_rise_rate": "-0.003296" } ];
|
|
82
|
+
|
|
83
|
+
chart.refresh();
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
</script>
|
|
89
|
+
</head>
|
|
90
|
+
<body>
|
|
91
|
+
<div id="mycanvas">
|
|
92
|
+
</div>
|
|
93
|
+
</body>
|
|
41
94
|
</html>
|