@amcharts/amcharts5 5.1.9 → 5.1.12
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/.internal/charts/hierarchy/ForceDirected.d.ts +1 -0
- package/.internal/charts/hierarchy/ForceDirected.d.ts.map +1 -1
- package/.internal/charts/hierarchy/ForceDirected.js +9 -0
- package/.internal/charts/hierarchy/ForceDirected.js.map +1 -1
- package/.internal/charts/hierarchy/LinkedHierarchy.d.ts +1 -0
- package/.internal/charts/hierarchy/LinkedHierarchy.d.ts.map +1 -1
- package/.internal/charts/hierarchy/LinkedHierarchy.js +12 -3
- package/.internal/charts/hierarchy/LinkedHierarchy.js.map +1 -1
- package/.internal/charts/radar/RadarChart.d.ts.map +1 -1
- package/.internal/charts/radar/RadarChart.js +0 -2
- package/.internal/charts/radar/RadarChart.js.map +1 -1
- package/.internal/charts/xy/XYChart.d.ts +8 -1
- package/.internal/charts/xy/XYChart.d.ts.map +1 -1
- package/.internal/charts/xy/XYChart.js +22 -3
- package/.internal/charts/xy/XYChart.js.map +1 -1
- package/.internal/charts/xy/XYChartDefaultTheme.d.ts.map +1 -1
- package/.internal/charts/xy/XYChartDefaultTheme.js +0 -2
- package/.internal/charts/xy/XYChartDefaultTheme.js.map +1 -1
- package/.internal/charts/xy/axes/Axis.d.ts.map +1 -1
- package/.internal/charts/xy/axes/Axis.js +1 -0
- package/.internal/charts/xy/axes/Axis.js.map +1 -1
- package/.internal/charts/xy/axes/AxisRendererX.d.ts.map +1 -1
- package/.internal/charts/xy/axes/AxisRendererX.js +1 -0
- package/.internal/charts/xy/axes/AxisRendererX.js.map +1 -1
- package/.internal/charts/xy/axes/DateAxis.d.ts.map +1 -1
- package/.internal/charts/xy/axes/DateAxis.js +46 -4
- package/.internal/charts/xy/axes/DateAxis.js.map +1 -1
- package/.internal/charts/xy/axes/ValueAxis.d.ts +13 -0
- package/.internal/charts/xy/axes/ValueAxis.d.ts.map +1 -1
- package/.internal/charts/xy/axes/ValueAxis.js +125 -75
- package/.internal/charts/xy/axes/ValueAxis.js.map +1 -1
- package/.internal/charts/xy/series/BaseColumnSeries.d.ts.map +1 -1
- package/.internal/charts/xy/series/BaseColumnSeries.js +9 -0
- package/.internal/charts/xy/series/BaseColumnSeries.js.map +1 -1
- package/.internal/charts/xy/series/XYSeries.d.ts +11 -0
- package/.internal/charts/xy/series/XYSeries.d.ts.map +1 -1
- package/.internal/charts/xy/series/XYSeries.js +44 -11
- package/.internal/charts/xy/series/XYSeries.js.map +1 -1
- package/.internal/core/Root.d.ts +1 -0
- package/.internal/core/Root.d.ts.map +1 -1
- package/.internal/core/Root.js +11 -2
- package/.internal/core/Root.js.map +1 -1
- package/.internal/core/render/GridLayout.d.ts.map +1 -1
- package/.internal/core/render/GridLayout.js +11 -9
- package/.internal/core/render/GridLayout.js.map +1 -1
- package/.internal/core/render/HorizontalLayout.d.ts.map +1 -1
- package/.internal/core/render/HorizontalLayout.js +40 -34
- package/.internal/core/render/HorizontalLayout.js.map +1 -1
- package/.internal/core/render/Legend.d.ts.map +1 -1
- package/.internal/core/render/Legend.js +7 -0
- package/.internal/core/render/Legend.js.map +1 -1
- package/.internal/core/render/Scrollbar.d.ts.map +1 -1
- package/.internal/core/render/Scrollbar.js +3 -0
- package/.internal/core/render/Scrollbar.js.map +1 -1
- package/.internal/core/render/Series.d.ts +5 -0
- package/.internal/core/render/Series.d.ts.map +1 -1
- package/.internal/core/render/Series.js +40 -10
- package/.internal/core/render/Series.js.map +1 -1
- package/.internal/core/render/Sprite.d.ts +4 -0
- package/.internal/core/render/Sprite.d.ts.map +1 -1
- package/.internal/core/render/Sprite.js +14 -0
- package/.internal/core/render/Sprite.js.map +1 -1
- package/.internal/core/render/VerticalLayout.d.ts.map +1 -1
- package/.internal/core/render/VerticalLayout.js +40 -34
- package/.internal/core/render/VerticalLayout.js.map +1 -1
- package/.internal/core/render/backend/CanvasRenderer.d.ts +1 -0
- package/.internal/core/render/backend/CanvasRenderer.d.ts.map +1 -1
- package/.internal/core/render/backend/CanvasRenderer.js +17 -1
- package/.internal/core/render/backend/CanvasRenderer.js.map +1 -1
- package/.internal/core/render/backend/Renderer.d.ts +1 -0
- package/.internal/core/render/backend/Renderer.d.ts.map +1 -1
- package/.internal/core/render/backend/Renderer.js.map +1 -1
- package/.internal/core/util/PopulateString.js +12 -2
- package/.internal/core/util/PopulateString.js.map +1 -1
- package/.internal/core/util/Time.d.ts.map +1 -1
- package/.internal/core/util/Time.js +4 -0
- package/.internal/core/util/Time.js.map +1 -1
- package/.internal/plugins/exporting/ExportingMenu.d.ts.map +1 -1
- package/.internal/plugins/exporting/ExportingMenu.js +3 -2
- package/.internal/plugins/exporting/ExportingMenu.js.map +1 -1
- package/.internal/plugins/json/Classes-script.d.ts +271 -0
- package/.internal/plugins/json/Classes-script.d.ts.map +1 -0
- package/.internal/plugins/json/Classes-script.js +139 -0
- package/.internal/plugins/json/Classes-script.js.map +1 -0
- package/.internal/plugins/json/Classes.d.ts +262 -262
- package/.internal/plugins/json/Classes.d.ts.map +1 -1
- package/.internal/plugins/json/Classes.js +131 -262
- package/.internal/plugins/json/Classes.js.map +1 -1
- package/.internal/plugins/json/Json.d.ts +3 -3
- package/.internal/plugins/json/Json.d.ts.map +1 -1
- package/.internal/plugins/json/Json.js +301 -34
- package/.internal/plugins/json/Json.js.map +1 -1
- package/CHANGELOG.md +45 -0
- package/examples/javascript/flow-chord/package.json +1 -1
- package/examples/javascript/flow-chord-directed/package.json +1 -1
- package/examples/javascript/flow-chord-non-ribbon/package.json +1 -1
- package/examples/javascript/flow-sankey/package.json +1 -1
- package/examples/javascript/gauge/package.json +1 -1
- package/examples/javascript/gauge-bands/package.json +1 -1
- package/examples/javascript/hierarchy-force-directed/package.json +1 -1
- package/examples/javascript/hierarchy-pack/package.json +1 -1
- package/examples/javascript/hierarchy-partition/package.json +1 -1
- package/examples/javascript/hierarchy-sunburst/package.json +1 -1
- package/examples/javascript/hierarchy-tree/package.json +1 -1
- package/examples/javascript/hierarchy-treemap/package.json +1 -1
- package/examples/javascript/json/README.md +6 -0
- package/examples/javascript/json/index.css +11 -0
- package/examples/javascript/json/index.html +12 -0
- package/examples/javascript/json/index.js +206 -0
- package/examples/javascript/json/package.json +16 -0
- package/examples/javascript/json/webpack.config.js +38 -0
- package/examples/javascript/map-animating-along-lines/package.json +1 -1
- package/examples/javascript/map-day-and-night/package.json +1 -1
- package/examples/javascript/map-globe-rotate-to-country/package.json +1 -1
- package/examples/javascript/map-globe-with-projected-circles/package.json +1 -1
- package/examples/javascript/map-with-bubbles/package.json +1 -1
- package/examples/javascript/map-zoom-to-country/package.json +1 -1
- package/examples/javascript/misc-40-charts/package.json +1 -1
- package/examples/javascript/misc-microchart-grid/package.json +1 -1
- package/examples/javascript/pie-chart/package.json +1 -1
- package/examples/javascript/pie-donut-chart/package.json +1 -1
- package/examples/javascript/pie-variable-radius/package.json +1 -1
- package/examples/javascript/radar-column-iwatch-style/package.json +1 -1
- package/examples/javascript/radar-heat-map/package.json +1 -1
- package/examples/javascript/radar-line/package.json +1 -1
- package/examples/javascript/radar-time-line/package.json +1 -1
- package/examples/javascript/sliced-funnel/package.json +1 -1
- package/examples/javascript/sliced-pictorial-stacked/package.json +1 -1
- package/examples/javascript/sliced-pyramid/package.json +1 -1
- package/examples/javascript/venn-diagram/package.json +1 -1
- package/examples/javascript/wordcloud-with-data/package.json +1 -1
- package/examples/javascript/wordcloud-with-text/package.json +1 -1
- package/examples/javascript/xy-100-percent-stacked-column/package.json +1 -1
- package/examples/javascript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
- package/examples/javascript/xy-bubble/package.json +1 -1
- package/examples/javascript/xy-candlestick/package.json +1 -1
- package/examples/javascript/xy-clustered-column/package.json +1 -1
- package/examples/javascript/xy-column/package.json +1 -1
- package/examples/javascript/xy-comparing-series-google-analytics-style/package.json +1 -1
- package/examples/javascript/xy-data-grouping/package.json +1 -1
- package/examples/javascript/xy-draggable-range/package.json +1 -1
- package/examples/javascript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
- package/examples/javascript/xy-dumbbell plot/package.json +1 -1
- package/examples/javascript/xy-evenly-spaced-date-axis/package.json +1 -1
- package/examples/javascript/xy-line/package.json +1 -1
- package/examples/javascript/xy-line-highlight-on-legend-hover/package.json +1 -1
- package/examples/javascript/xy-live-data/package.json +1 -1
- package/examples/javascript/xy-multiple-synced-value-axes/package.json +1 -1
- package/examples/javascript/xy-ohlc/package.json +1 -1
- package/examples/javascript/xy-real-time-data-sorting/package.json +1 -1
- package/examples/javascript/xy-smoothed-line/package.json +1 -1
- package/examples/javascript/xy-stacked-and-clustered-column/package.json +1 -1
- package/examples/javascript/xy-stacked-column/package.json +1 -1
- package/examples/javascript/xy-stacked-step/package.json +1 -1
- package/examples/javascript/xy-stock/package.json +1 -1
- package/examples/javascript/xy-stock-comparing/package.json +1 -1
- package/examples/typescript/flow-chord/package.json +1 -1
- package/examples/typescript/flow-chord/webpack.config.js +1 -1
- package/examples/typescript/flow-chord-directed/package.json +1 -1
- package/examples/typescript/flow-chord-directed/webpack.config.js +1 -1
- package/examples/typescript/flow-chord-non-ribbon/package.json +1 -1
- package/examples/typescript/flow-chord-non-ribbon/webpack.config.js +1 -1
- package/examples/typescript/flow-sankey/package.json +1 -1
- package/examples/typescript/flow-sankey/webpack.config.js +1 -1
- package/examples/typescript/gauge/package.json +1 -1
- package/examples/typescript/gauge/webpack.config.js +1 -1
- package/examples/typescript/gauge-bands/package.json +1 -1
- package/examples/typescript/gauge-bands/webpack.config.js +1 -1
- package/examples/typescript/hierarchy-force-directed/package.json +1 -1
- package/examples/typescript/hierarchy-force-directed/webpack.config.js +1 -1
- package/examples/typescript/hierarchy-pack/package.json +1 -1
- package/examples/typescript/hierarchy-pack/webpack.config.js +1 -1
- package/examples/typescript/hierarchy-partition/package.json +1 -1
- package/examples/typescript/hierarchy-partition/webpack.config.js +1 -1
- package/examples/typescript/hierarchy-sunburst/package.json +1 -1
- package/examples/typescript/hierarchy-sunburst/webpack.config.js +1 -1
- package/examples/typescript/hierarchy-tree/package.json +1 -1
- package/examples/typescript/hierarchy-tree/webpack.config.js +1 -1
- package/examples/typescript/hierarchy-treemap/package.json +1 -1
- package/examples/typescript/hierarchy-treemap/webpack.config.js +1 -1
- package/examples/typescript/json/README.md +6 -0
- package/examples/typescript/json/index.css +11 -0
- package/examples/typescript/json/index.html +12 -0
- package/examples/typescript/json/index.ts +206 -0
- package/examples/typescript/json/package.json +18 -0
- package/examples/typescript/json/tsconfig.json +12 -0
- package/examples/typescript/json/webpack.config.js +45 -0
- package/examples/typescript/map-animating-along-lines/package.json +1 -1
- package/examples/typescript/map-animating-along-lines/webpack.config.js +1 -1
- package/examples/typescript/map-day-and-night/package.json +1 -1
- package/examples/typescript/map-day-and-night/webpack.config.js +1 -1
- package/examples/typescript/map-globe-rotate-to-country/package.json +1 -1
- package/examples/typescript/map-globe-rotate-to-country/webpack.config.js +1 -1
- package/examples/typescript/map-globe-with-projected-circles/package.json +1 -1
- package/examples/typescript/map-globe-with-projected-circles/webpack.config.js +1 -1
- package/examples/typescript/map-with-bubbles/package.json +1 -1
- package/examples/typescript/map-with-bubbles/webpack.config.js +1 -1
- package/examples/typescript/map-zoom-to-country/package.json +1 -1
- package/examples/typescript/map-zoom-to-country/webpack.config.js +1 -1
- package/examples/typescript/misc-40-charts/package.json +1 -1
- package/examples/typescript/misc-40-charts/webpack.config.js +1 -1
- package/examples/typescript/misc-microchart-grid/package.json +1 -1
- package/examples/typescript/misc-microchart-grid/webpack.config.js +1 -1
- package/examples/typescript/pie-chart/package.json +1 -1
- package/examples/typescript/pie-chart/webpack.config.js +1 -1
- package/examples/typescript/pie-donut-chart/package.json +1 -1
- package/examples/typescript/pie-donut-chart/webpack.config.js +1 -1
- package/examples/typescript/pie-variable-radius/package.json +1 -1
- package/examples/typescript/pie-variable-radius/webpack.config.js +1 -1
- package/examples/typescript/radar-column-iwatch-style/package.json +1 -1
- package/examples/typescript/radar-column-iwatch-style/webpack.config.js +1 -1
- package/examples/typescript/radar-heat-map/package.json +1 -1
- package/examples/typescript/radar-heat-map/webpack.config.js +1 -1
- package/examples/typescript/radar-line/package.json +1 -1
- package/examples/typescript/radar-line/webpack.config.js +1 -1
- package/examples/typescript/radar-time-line/package.json +1 -1
- package/examples/typescript/radar-time-line/webpack.config.js +1 -1
- package/examples/typescript/sliced-funnel/package.json +1 -1
- package/examples/typescript/sliced-funnel/webpack.config.js +1 -1
- package/examples/typescript/sliced-pictorial-stacked/package.json +1 -1
- package/examples/typescript/sliced-pictorial-stacked/webpack.config.js +1 -1
- package/examples/typescript/sliced-pyramid/package.json +1 -1
- package/examples/typescript/sliced-pyramid/webpack.config.js +1 -1
- package/examples/typescript/venn-diagram/package.json +1 -1
- package/examples/typescript/venn-diagram/webpack.config.js +1 -1
- package/examples/typescript/wordcloud-with-data/package.json +1 -1
- package/examples/typescript/wordcloud-with-data/webpack.config.js +1 -1
- package/examples/typescript/wordcloud-with-text/package.json +1 -1
- package/examples/typescript/wordcloud-with-text/webpack.config.js +1 -1
- package/examples/typescript/xy-100-percent-stacked-column/package.json +1 -1
- package/examples/typescript/xy-100-percent-stacked-column/webpack.config.js +1 -1
- package/examples/typescript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
- package/examples/typescript/xy-animated-bullet-at-the-end-of-the-series/webpack.config.js +1 -1
- package/examples/typescript/xy-bubble/package.json +1 -1
- package/examples/typescript/xy-bubble/webpack.config.js +1 -1
- package/examples/typescript/xy-candlestick/package.json +1 -1
- package/examples/typescript/xy-candlestick/webpack.config.js +1 -1
- package/examples/typescript/xy-clustered-column/package.json +1 -1
- package/examples/typescript/xy-clustered-column/webpack.config.js +1 -1
- package/examples/typescript/xy-column/package.json +1 -1
- package/examples/typescript/xy-column/webpack.config.js +1 -1
- package/examples/typescript/xy-comparing-series-google-analytics-style/package.json +1 -1
- package/examples/typescript/xy-comparing-series-google-analytics-style/webpack.config.js +1 -1
- package/examples/typescript/xy-data-grouping/package.json +1 -1
- package/examples/typescript/xy-data-grouping/webpack.config.js +1 -1
- package/examples/typescript/xy-draggable-range/package.json +1 -1
- package/examples/typescript/xy-draggable-range/webpack.config.js +1 -1
- package/examples/typescript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
- package/examples/typescript/xy-drawing-series-with-mouse-or-touch/webpack.config.js +1 -1
- package/examples/typescript/xy-dumbbell plot/package.json +1 -1
- package/examples/typescript/xy-dumbbell plot/webpack.config.js +1 -1
- package/examples/typescript/xy-evenly-spaced-date-axis/package.json +1 -1
- package/examples/typescript/xy-evenly-spaced-date-axis/webpack.config.js +1 -1
- package/examples/typescript/xy-line/package.json +1 -1
- package/examples/typescript/xy-line/webpack.config.js +1 -1
- package/examples/typescript/xy-line-highlight-on-legend-hover/package.json +1 -1
- package/examples/typescript/xy-line-highlight-on-legend-hover/webpack.config.js +1 -1
- package/examples/typescript/xy-live-data/package.json +1 -1
- package/examples/typescript/xy-live-data/webpack.config.js +1 -1
- package/examples/typescript/xy-multiple-synced-value-axes/package.json +1 -1
- package/examples/typescript/xy-multiple-synced-value-axes/webpack.config.js +1 -1
- package/examples/typescript/xy-ohlc/package.json +1 -1
- package/examples/typescript/xy-ohlc/webpack.config.js +1 -1
- package/examples/typescript/xy-real-time-data-sorting/package.json +1 -1
- package/examples/typescript/xy-real-time-data-sorting/webpack.config.js +1 -1
- package/examples/typescript/xy-smoothed-line/package.json +1 -1
- package/examples/typescript/xy-smoothed-line/webpack.config.js +1 -1
- package/examples/typescript/xy-stacked-and-clustered-column/package.json +1 -1
- package/examples/typescript/xy-stacked-and-clustered-column/webpack.config.js +1 -1
- package/examples/typescript/xy-stacked-column/package.json +1 -1
- package/examples/typescript/xy-stacked-column/webpack.config.js +1 -1
- package/examples/typescript/xy-stacked-step/package.json +1 -1
- package/examples/typescript/xy-stacked-step/webpack.config.js +1 -1
- package/examples/typescript/xy-stock/package.json +1 -1
- package/examples/typescript/xy-stock/webpack.config.js +1 -1
- package/examples/typescript/xy-stock-comparing/package.json +1 -1
- package/examples/typescript/xy-stock-comparing/webpack.config.js +1 -1
- package/index.d.ts +4 -0
- package/index.d.ts.map +1 -1
- package/index.js +4 -0
- package/index.js.map +1 -1
- package/locales/lt_LT.js +25 -25
- package/locales/lt_LT.js.map +1 -1
- package/package.json +9 -9
- package/xy.d.ts +1 -0
- package/xy.d.ts.map +1 -1
- package/xy.js +1 -0
- package/xy.js.map +1 -1
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import * as am5 from "@amcharts/amcharts5";
|
|
2
|
+
import * as am5xy from "@amcharts/amcharts5/xy";
|
|
3
|
+
import am5themes_Animated from "@amcharts/amcharts5/themes/Animated";
|
|
4
|
+
import * as am5plugins_json from "@amcharts/amcharts5/plugins/json";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
// Create root element
|
|
8
|
+
// https://www.amcharts.com/docs/v5/getting-started/#Root_element
|
|
9
|
+
const root = am5.Root.new("chartdiv");
|
|
10
|
+
|
|
11
|
+
// Set themes
|
|
12
|
+
// https://www.amcharts.com/docs/v5/concepts/themes/
|
|
13
|
+
root.setThemes([
|
|
14
|
+
am5themes_Animated.new(root)
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
// Specify date fields, so that they are formatted accordingly in tooltips
|
|
18
|
+
// https://www.amcharts.com/docs/v5/concepts/formatters/data-placeholders/#Formatting_placeholders
|
|
19
|
+
root.dateFormatter.setAll({
|
|
20
|
+
dateFields: ["valueX"]
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
async function main() {
|
|
25
|
+
const chart = await new am5plugins_json.JsonParser().parse(root, {
|
|
26
|
+
refs: {
|
|
27
|
+
data: [
|
|
28
|
+
{
|
|
29
|
+
"date": 1652425200000,
|
|
30
|
+
"value": 92
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"date": 1652511600000,
|
|
34
|
+
"value": 95
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"date": 1652598000000,
|
|
38
|
+
"value": 100
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"date": 1652684400000,
|
|
42
|
+
"value": 100
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"date": 1652770800000,
|
|
46
|
+
"value": 96
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"date": 1652857200000,
|
|
50
|
+
"value": 97
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"date": 1652943600000,
|
|
54
|
+
"value": 94
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"date": 1653030000000,
|
|
58
|
+
"value": 89
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"date": 1653116400000,
|
|
62
|
+
"value": 89
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"date": 1653202800000,
|
|
66
|
+
"value": 87
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"date": 1653289200000,
|
|
70
|
+
"value": 84
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"date": 1653375600000,
|
|
74
|
+
"value": 81
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"date": 1653462000000,
|
|
78
|
+
"value": 85
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"date": 1653548400000,
|
|
82
|
+
"value": 89
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"date": 1653634800000,
|
|
86
|
+
"value": 86
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"date": 1653721200000,
|
|
90
|
+
"value": 90
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"date": 1653807600000,
|
|
94
|
+
"value": 93
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"date": 1653894000000,
|
|
98
|
+
"value": 94
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"date": 1653980400000,
|
|
102
|
+
"value": 94
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"date": 1654066800000,
|
|
106
|
+
"value": 96
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
xAxis: {
|
|
110
|
+
type: "DateAxis",
|
|
111
|
+
settings: {
|
|
112
|
+
maxDeviation: 0.5,
|
|
113
|
+
baseInterval: {
|
|
114
|
+
timeUnit: "day",
|
|
115
|
+
count: 1
|
|
116
|
+
},
|
|
117
|
+
renderer: {
|
|
118
|
+
type: "AxisRendererX",
|
|
119
|
+
settings: {
|
|
120
|
+
pan: "zoom"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
tooltip: {
|
|
124
|
+
type: "Tooltip",
|
|
125
|
+
},
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
yAxis: {
|
|
129
|
+
type: "ValueAxis",
|
|
130
|
+
settings: {
|
|
131
|
+
maxDeviation: 1,
|
|
132
|
+
renderer: {
|
|
133
|
+
type: "AxisRendererY",
|
|
134
|
+
settings: {
|
|
135
|
+
pan: "zoom"
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
type: "XYChart",
|
|
142
|
+
settings: {
|
|
143
|
+
panX: false,
|
|
144
|
+
panY: false,
|
|
145
|
+
wheelX: "panX",
|
|
146
|
+
wheelY: "zoomX",
|
|
147
|
+
cursor: {
|
|
148
|
+
type: "XYCursor",
|
|
149
|
+
settings: {
|
|
150
|
+
behavior: "zoomX"
|
|
151
|
+
},
|
|
152
|
+
properties: {
|
|
153
|
+
lineY: {
|
|
154
|
+
settings: {
|
|
155
|
+
visible: false
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
scrollbarX: {
|
|
161
|
+
type: "Scrollbar",
|
|
162
|
+
settings: {
|
|
163
|
+
orientation: "horizontal"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
properties: {
|
|
168
|
+
xAxes: [
|
|
169
|
+
"#xAxis",
|
|
170
|
+
],
|
|
171
|
+
yAxes: [
|
|
172
|
+
"#yAxis",
|
|
173
|
+
],
|
|
174
|
+
series: [
|
|
175
|
+
{
|
|
176
|
+
type: "LineSeries",
|
|
177
|
+
settings: {
|
|
178
|
+
name: "Series",
|
|
179
|
+
xAxis: "#xAxis",
|
|
180
|
+
yAxis: "#yAxis",
|
|
181
|
+
valueYField: "value",
|
|
182
|
+
valueXField: "date",
|
|
183
|
+
tooltip: {
|
|
184
|
+
type: "Tooltip",
|
|
185
|
+
settings: {
|
|
186
|
+
labelText: "{valueX}: {valueY}"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
properties: {
|
|
191
|
+
data: "#data"
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
root.container.children.push(chart);
|
|
199
|
+
|
|
200
|
+
// Make stuff animate on load
|
|
201
|
+
// https://www.amcharts.com/docs/v5/concepts/animations/#Forcing_appearance_animation
|
|
202
|
+
chart.series.getIndex(0).appear(1000);
|
|
203
|
+
chart.appear(1000, 100);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
main();
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"private": true,
|
|
3
|
+
"name": "amcharts5-example-json",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"devDependencies": {
|
|
6
|
+
"@amcharts/amcharts5": "^5.1.12",
|
|
7
|
+
"source-map-loader": "^3.0.0",
|
|
8
|
+
"ts-loader": "^9.2.2",
|
|
9
|
+
"typescript": "^4.3.4",
|
|
10
|
+
"webpack": "^5.1.3",
|
|
11
|
+
"webpack-cli": "^4.1.0",
|
|
12
|
+
"webpack-dev-server": "^3.11.0"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "webpack",
|
|
16
|
+
"start": "webpack serve --mode development"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var $path = require("path");
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
mode: "production",
|
|
5
|
+
|
|
6
|
+
devtool: "source-map",
|
|
7
|
+
|
|
8
|
+
stats: "errors-warnings",
|
|
9
|
+
|
|
10
|
+
target: ["web", "es5"],
|
|
11
|
+
|
|
12
|
+
entry: {
|
|
13
|
+
index: "./index.ts",
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
devServer: {
|
|
17
|
+
publicPath: "/dist/",
|
|
18
|
+
liveReload: true,
|
|
19
|
+
overlay: true,
|
|
20
|
+
noInfo: true,
|
|
21
|
+
open: true
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
output: {
|
|
25
|
+
path: $path.resolve(__dirname, "dist"),
|
|
26
|
+
publicPath: "dist/",
|
|
27
|
+
filename: "[name].js",
|
|
28
|
+
chunkFilename: "[name].js"
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
resolve: {
|
|
32
|
+
extensions: [".ts", ".tsx", ".js"]
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
module: {
|
|
36
|
+
rules: [{
|
|
37
|
+
test: /.tsx?$/,
|
|
38
|
+
loader: "ts-loader"
|
|
39
|
+
}, {
|
|
40
|
+
test: /.js$/,
|
|
41
|
+
use: ["source-map-loader"],
|
|
42
|
+
enforce: "pre"
|
|
43
|
+
}]
|
|
44
|
+
}
|
|
45
|
+
};
|