@amcharts/amcharts5 5.11.2 → 5.12.0
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/radar/RadarChart.d.ts +1 -0
- package/.internal/charts/radar/RadarChart.d.ts.map +1 -1
- package/.internal/charts/radar/RadarChart.js +4 -0
- package/.internal/charts/radar/RadarChart.js.map +1 -1
- package/.internal/charts/stock/SettingsModal.d.ts +1 -0
- package/.internal/charts/stock/SettingsModal.d.ts.map +1 -1
- package/.internal/charts/stock/SettingsModal.js +11 -3
- package/.internal/charts/stock/SettingsModal.js.map +1 -1
- package/.internal/charts/stock/indicators/Indicator.d.ts +1 -1
- package/.internal/charts/stock/indicators/Indicator.d.ts.map +1 -1
- package/.internal/charts/stock/indicators/Indicator.js.map +1 -1
- package/.internal/charts/stock/toolbar/DrawingControl.d.ts.map +1 -1
- package/.internal/charts/stock/toolbar/DrawingControl.js +6 -3
- package/.internal/charts/stock/toolbar/DrawingControl.js.map +1 -1
- package/.internal/charts/timeline/AxisRendererCurveX.d.ts +132 -0
- package/.internal/charts/timeline/AxisRendererCurveX.d.ts.map +1 -0
- package/.internal/charts/timeline/AxisRendererCurveX.js +537 -0
- package/.internal/charts/timeline/AxisRendererCurveX.js.map +1 -0
- package/.internal/charts/timeline/AxisRendererCurveY.d.ts +132 -0
- package/.internal/charts/timeline/AxisRendererCurveY.d.ts.map +1 -0
- package/.internal/charts/timeline/AxisRendererCurveY.js +308 -0
- package/.internal/charts/timeline/AxisRendererCurveY.js.map +1 -0
- package/.internal/charts/timeline/CurveChart.d.ts +63 -0
- package/.internal/charts/timeline/CurveChart.d.ts.map +1 -0
- package/.internal/charts/timeline/CurveChart.js +123 -0
- package/.internal/charts/timeline/CurveChart.js.map +1 -0
- package/.internal/charts/timeline/CurveColumnSeries.d.ts +66 -0
- package/.internal/charts/timeline/CurveColumnSeries.d.ts.map +1 -0
- package/.internal/charts/timeline/CurveColumnSeries.js +163 -0
- package/.internal/charts/timeline/CurveColumnSeries.js.map +1 -0
- package/.internal/charts/timeline/CurveCursor.d.ts +61 -0
- package/.internal/charts/timeline/CurveCursor.d.ts.map +1 -0
- package/.internal/charts/timeline/CurveCursor.js +134 -0
- package/.internal/charts/timeline/CurveCursor.js.map +1 -0
- package/.internal/charts/timeline/CurveDefaultTheme.d.ts +8 -0
- package/.internal/charts/timeline/CurveDefaultTheme.d.ts.map +1 -0
- package/.internal/charts/timeline/CurveDefaultTheme.js +72 -0
- package/.internal/charts/timeline/CurveDefaultTheme.js.map +1 -0
- package/.internal/charts/timeline/CurveLineSeries.d.ts +40 -0
- package/.internal/charts/timeline/CurveLineSeries.d.ts.map +1 -0
- package/.internal/charts/timeline/CurveLineSeries.js +101 -0
- package/.internal/charts/timeline/CurveLineSeries.js.map +1 -0
- package/.internal/charts/timeline/SerpentineChart.d.ts +60 -0
- package/.internal/charts/timeline/SerpentineChart.d.ts.map +1 -0
- package/.internal/charts/timeline/SerpentineChart.js +146 -0
- package/.internal/charts/timeline/SerpentineChart.js.map +1 -0
- package/.internal/charts/timeline/SpiralChart.d.ts +60 -0
- package/.internal/charts/timeline/SpiralChart.d.ts.map +1 -0
- package/.internal/charts/timeline/SpiralChart.js +58 -0
- package/.internal/charts/timeline/SpiralChart.js.map +1 -0
- package/.internal/charts/xy/axes/DateAxis.d.ts.map +1 -1
- package/.internal/charts/xy/axes/DateAxis.js +1 -0
- package/.internal/charts/xy/axes/DateAxis.js.map +1 -1
- package/.internal/charts/xy/series/BaseColumnSeries.d.ts.map +1 -1
- package/.internal/charts/xy/series/BaseColumnSeries.js +3 -1
- package/.internal/charts/xy/series/BaseColumnSeries.js.map +1 -1
- package/.internal/core/Classes.d.ts +16 -0
- package/.internal/core/Classes.d.ts.map +1 -1
- package/.internal/core/Classes.js.map +1 -1
- package/.internal/core/Registry.js +1 -1
- package/.internal/core/Registry.js.map +1 -1
- package/.internal/core/render/SerialChart.d.ts.map +1 -1
- package/.internal/core/render/SerialChart.js +12 -0
- package/.internal/core/render/SerialChart.js.map +1 -1
- package/.internal/core/render/Sprite.d.ts +7 -0
- package/.internal/core/render/Sprite.d.ts.map +1 -1
- package/.internal/core/render/Sprite.js +10 -0
- package/.internal/core/render/Sprite.js.map +1 -1
- package/.internal/core/util/List.d.ts +12 -0
- package/.internal/core/util/List.d.ts.map +1 -1
- package/.internal/core/util/List.js +23 -2
- package/.internal/core/util/List.js.map +1 -1
- package/.internal/core/util/Math.d.ts.map +1 -1
- package/.internal/core/util/Math.js +12 -5
- package/.internal/core/util/Math.js.map +1 -1
- package/.internal/plugins/json/Classes-script.d.ts +16 -0
- package/.internal/plugins/json/Classes-script.d.ts.map +1 -1
- package/.internal/plugins/json/Classes-script.js +8 -0
- package/.internal/plugins/json/Classes-script.js.map +1 -1
- package/.internal/plugins/json/Classes.d.ts +16 -0
- package/.internal/plugins/json/Classes.d.ts.map +1 -1
- package/.internal/plugins/json/Classes.js +8 -0
- package/.internal/plugins/json/Classes.js.map +1 -1
- package/CHANGELOG.md +24 -0
- package/examples/javascript/flow-arc-horizontal/package.json +1 -1
- package/examples/javascript/flow-arc-vertical/package.json +1 -1
- 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/hierarchy-voronoi-treemap/package.json +1 -1
- package/examples/javascript/jest/package.json +1 -1
- package/examples/javascript/json-pie/package.json +1 -1
- package/examples/javascript/json-xy/package.json +1 -1
- package/examples/javascript/map-animating-along-lines/package.json +1 -1
- package/examples/javascript/map-clustered-points/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/stock-chart/package.json +1 -1
- package/examples/javascript/stock-chart-comparing-stocks/package.json +1 -1
- package/examples/javascript/stock-chart-data-granularity/package.json +1 -1
- package/examples/javascript/stock-chart-data-grouping/package.json +1 -1
- package/examples/javascript/stock-chart-intraday/package.json +1 -1
- package/examples/javascript/stock-chart-live/package.json +1 -1
- package/examples/javascript/stock-chart-volume-separate-panel/package.json +1 -1
- package/examples/javascript/timeline-horizontal-serpentine-chart/README.md +6 -0
- package/examples/javascript/timeline-horizontal-serpentine-chart/index.css +11 -0
- package/examples/javascript/timeline-horizontal-serpentine-chart/index.html +12 -0
- package/examples/javascript/timeline-horizontal-serpentine-chart/index.js +268 -0
- package/examples/javascript/timeline-horizontal-serpentine-chart/package.json +16 -0
- package/examples/javascript/timeline-horizontal-serpentine-chart/webpack.config.js +38 -0
- package/examples/javascript/timeline-linear-process-diagram/README.md +6 -0
- package/examples/javascript/timeline-linear-process-diagram/index.css +11 -0
- package/examples/javascript/timeline-linear-process-diagram/index.html +12 -0
- package/examples/javascript/timeline-linear-process-diagram/index.js +365 -0
- package/examples/javascript/timeline-linear-process-diagram/package.json +16 -0
- package/examples/javascript/timeline-linear-process-diagram/webpack.config.js +38 -0
- package/examples/javascript/timeline-serpentine-chart/README.md +6 -0
- package/examples/javascript/timeline-serpentine-chart/index.css +11 -0
- package/examples/javascript/timeline-serpentine-chart/index.html +12 -0
- package/examples/javascript/timeline-serpentine-chart/index.js +274 -0
- package/examples/javascript/timeline-serpentine-chart/package.json +16 -0
- package/examples/javascript/timeline-serpentine-chart/webpack.config.js +38 -0
- package/examples/javascript/timeline-spiral-chart/README.md +6 -0
- package/examples/javascript/timeline-spiral-chart/index.css +11 -0
- package/examples/javascript/timeline-spiral-chart/index.html +12 -0
- package/examples/javascript/timeline-spiral-chart/index.js +274 -0
- package/examples/javascript/timeline-spiral-chart/package.json +16 -0
- package/examples/javascript/timeline-spiral-chart/webpack.config.js +38 -0
- 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-arc-horizontal/package.json +1 -1
- package/examples/typescript/flow-arc-vertical/package.json +1 -1
- package/examples/typescript/flow-chord/package.json +1 -1
- package/examples/typescript/flow-chord-directed/package.json +1 -1
- package/examples/typescript/flow-chord-non-ribbon/package.json +1 -1
- package/examples/typescript/flow-sankey/package.json +1 -1
- package/examples/typescript/gauge/package.json +1 -1
- package/examples/typescript/gauge-bands/package.json +1 -1
- package/examples/typescript/hierarchy-force-directed/package.json +1 -1
- package/examples/typescript/hierarchy-pack/package.json +1 -1
- package/examples/typescript/hierarchy-partition/package.json +1 -1
- package/examples/typescript/hierarchy-sunburst/package.json +1 -1
- package/examples/typescript/hierarchy-tree/package.json +1 -1
- package/examples/typescript/hierarchy-treemap/package.json +1 -1
- package/examples/typescript/hierarchy-voronoi-treemap/package.json +1 -1
- package/examples/typescript/jest/package.json +1 -1
- package/examples/typescript/json-pie/package.json +1 -1
- package/examples/typescript/json-xy/package.json +1 -1
- package/examples/typescript/map-animating-along-lines/package.json +1 -1
- package/examples/typescript/map-clustered-points/package.json +1 -1
- package/examples/typescript/map-day-and-night/package.json +1 -1
- package/examples/typescript/map-globe-rotate-to-country/package.json +1 -1
- package/examples/typescript/map-globe-with-projected-circles/package.json +1 -1
- package/examples/typescript/map-with-bubbles/package.json +1 -1
- package/examples/typescript/map-zoom-to-country/package.json +1 -1
- package/examples/typescript/misc-40-charts/package.json +1 -1
- package/examples/typescript/misc-microchart-grid/package.json +1 -1
- package/examples/typescript/pie-chart/package.json +1 -1
- package/examples/typescript/pie-donut-chart/package.json +1 -1
- package/examples/typescript/pie-variable-radius/package.json +1 -1
- package/examples/typescript/radar-column-iwatch-style/package.json +1 -1
- package/examples/typescript/radar-heat-map/package.json +1 -1
- package/examples/typescript/radar-line/package.json +1 -1
- package/examples/typescript/radar-time-line/package.json +1 -1
- package/examples/typescript/sliced-funnel/package.json +1 -1
- package/examples/typescript/sliced-pictorial-stacked/package.json +1 -1
- package/examples/typescript/sliced-pyramid/package.json +1 -1
- package/examples/typescript/stock-chart/package.json +1 -1
- package/examples/typescript/stock-chart-comparing-stocks/package.json +1 -1
- package/examples/typescript/stock-chart-data-granularity/package.json +1 -1
- package/examples/typescript/stock-chart-data-grouping/package.json +1 -1
- package/examples/typescript/stock-chart-intraday/package.json +1 -1
- package/examples/typescript/stock-chart-live/package.json +1 -1
- package/examples/typescript/stock-chart-volume-separate-panel/package.json +1 -1
- package/examples/typescript/timeline-horizontal-serpentine-chart/README.md +6 -0
- package/examples/typescript/timeline-horizontal-serpentine-chart/index.css +11 -0
- package/examples/typescript/timeline-horizontal-serpentine-chart/index.html +12 -0
- package/examples/typescript/timeline-horizontal-serpentine-chart/index.ts +268 -0
- package/examples/typescript/timeline-horizontal-serpentine-chart/package.json +18 -0
- package/examples/typescript/timeline-horizontal-serpentine-chart/tsconfig.json +12 -0
- package/examples/typescript/timeline-horizontal-serpentine-chart/webpack.config.js +45 -0
- package/examples/typescript/timeline-linear-process-diagram/README.md +6 -0
- package/examples/typescript/timeline-linear-process-diagram/index.css +11 -0
- package/examples/typescript/timeline-linear-process-diagram/index.html +12 -0
- package/examples/typescript/timeline-linear-process-diagram/index.ts +365 -0
- package/examples/typescript/timeline-linear-process-diagram/package.json +18 -0
- package/examples/typescript/timeline-linear-process-diagram/tsconfig.json +12 -0
- package/examples/typescript/timeline-linear-process-diagram/webpack.config.js +45 -0
- package/examples/typescript/timeline-serpentine-chart/README.md +6 -0
- package/examples/typescript/timeline-serpentine-chart/index.css +11 -0
- package/examples/typescript/timeline-serpentine-chart/index.html +12 -0
- package/examples/typescript/timeline-serpentine-chart/index.ts +274 -0
- package/examples/typescript/timeline-serpentine-chart/package.json +18 -0
- package/examples/typescript/timeline-serpentine-chart/tsconfig.json +12 -0
- package/examples/typescript/timeline-serpentine-chart/webpack.config.js +45 -0
- package/examples/typescript/timeline-spiral-chart/README.md +6 -0
- package/examples/typescript/timeline-spiral-chart/index.css +11 -0
- package/examples/typescript/timeline-spiral-chart/index.html +12 -0
- package/examples/typescript/timeline-spiral-chart/index.ts +274 -0
- package/examples/typescript/timeline-spiral-chart/package.json +18 -0
- package/examples/typescript/timeline-spiral-chart/tsconfig.json +12 -0
- package/examples/typescript/timeline-spiral-chart/webpack.config.js +45 -0
- package/examples/typescript/venn-diagram/package.json +1 -1
- package/examples/typescript/wordcloud-with-data/package.json +1 -1
- package/examples/typescript/wordcloud-with-text/package.json +1 -1
- package/examples/typescript/xy-100-percent-stacked-column/package.json +1 -1
- package/examples/typescript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
- package/examples/typescript/xy-bubble/package.json +1 -1
- package/examples/typescript/xy-candlestick/package.json +1 -1
- package/examples/typescript/xy-clustered-column/package.json +1 -1
- package/examples/typescript/xy-column/package.json +1 -1
- package/examples/typescript/xy-comparing-series-google-analytics-style/package.json +1 -1
- package/examples/typescript/xy-data-grouping/package.json +1 -1
- package/examples/typescript/xy-draggable-range/package.json +1 -1
- package/examples/typescript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
- package/examples/typescript/xy-dumbbell plot/package.json +1 -1
- package/examples/typescript/xy-evenly-spaced-date-axis/package.json +1 -1
- package/examples/typescript/xy-line/package.json +1 -1
- package/examples/typescript/xy-line-highlight-on-legend-hover/package.json +1 -1
- package/examples/typescript/xy-live-data/package.json +1 -1
- package/examples/typescript/xy-multiple-synced-value-axes/package.json +1 -1
- package/examples/typescript/xy-ohlc/package.json +1 -1
- package/examples/typescript/xy-real-time-data-sorting/package.json +1 -1
- package/examples/typescript/xy-smoothed-line/package.json +1 -1
- package/examples/typescript/xy-stacked-and-clustered-column/package.json +1 -1
- package/examples/typescript/xy-stacked-column/package.json +1 -1
- package/examples/typescript/xy-stacked-step/package.json +1 -1
- package/examples/typescript/xy-stock/package.json +1 -1
- package/examples/typescript/xy-stock-comparing/package.json +1 -1
- package/package.json +1 -1
- package/timeline.d.ts +11 -0
- package/timeline.d.ts.map +1 -0
- package/timeline.js +11 -0
- package/timeline.js.map +1 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import * as am5 from "@amcharts/amcharts5";
|
|
2
|
+
import * as am5xy from "@amcharts/amcharts5/xy";
|
|
3
|
+
import * as am5timeline from "@amcharts/amcharts5/timeline";
|
|
4
|
+
import am5themes_Animated from "@amcharts/amcharts5/themes/Animated";
|
|
5
|
+
|
|
6
|
+
const root = am5.Root.new("chartdiv");
|
|
7
|
+
|
|
8
|
+
// Set themes
|
|
9
|
+
// https://www.amcharts.com/docs/v5/concepts/themes/
|
|
10
|
+
root.setThemes([
|
|
11
|
+
am5themes_Animated.new(root)
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
// Create chart
|
|
16
|
+
const chart = root.container.children.push(am5timeline.SerpentineChart.new(root, {
|
|
17
|
+
orientation: "horizontal",
|
|
18
|
+
levelCount: 6,
|
|
19
|
+
startLocation: 0.2,
|
|
20
|
+
endLocation: 1,
|
|
21
|
+
wheelY: "zoomX"
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
chart.set("scrollbarX", am5.Scrollbar.new(root, {
|
|
25
|
+
orientation: "horizontal"
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
const yRenderer = am5timeline.AxisRendererCurveY.new(root, {
|
|
29
|
+
rotateLabels: true
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
yRenderer.labels.template.setAll({
|
|
33
|
+
centerY: am5.p50,
|
|
34
|
+
centerX: am5.p100,
|
|
35
|
+
fontSize: 11
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
yRenderer.grid.template.set("forceHidden", true);
|
|
39
|
+
|
|
40
|
+
// Create axes and their renderers
|
|
41
|
+
const xRenderer = am5timeline.AxisRendererCurveX.new(root, {
|
|
42
|
+
yRenderer: yRenderer,
|
|
43
|
+
strokeDasharray: [2, 3],
|
|
44
|
+
strokeOpacity: 0.5,
|
|
45
|
+
stroke: am5.color(0x000000)
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
xRenderer.labels.template.setAll({
|
|
49
|
+
centerY: am5.p50,
|
|
50
|
+
fontSize: 11,
|
|
51
|
+
minPosition: 0.01
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
xRenderer.labels.template.setup = function(target) {
|
|
55
|
+
target.set("layer", 30);
|
|
56
|
+
target.set("background", am5.Rectangle.new(root, {
|
|
57
|
+
fill: am5.color(0xffffff),
|
|
58
|
+
fillOpacity: 1
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const yAxis = chart.yAxes.push(am5xy.CategoryAxis.new(root, {
|
|
63
|
+
maxDeviation: 0,
|
|
64
|
+
categoryField: "category",
|
|
65
|
+
renderer: yRenderer
|
|
66
|
+
}));
|
|
67
|
+
|
|
68
|
+
const xAxis = chart.xAxes.push(am5xy.DateAxis.new(root, {
|
|
69
|
+
baseInterval: { timeUnit: "day", count: 1 },
|
|
70
|
+
renderer: xRenderer,
|
|
71
|
+
tooltip: am5.Tooltip.new(root, {})
|
|
72
|
+
}));
|
|
73
|
+
|
|
74
|
+
// Data
|
|
75
|
+
const colorSet = chart.get("colors");
|
|
76
|
+
|
|
77
|
+
const data = [{
|
|
78
|
+
"category": "Module #1",
|
|
79
|
+
"start": new Date("2019-01-10").getTime(),
|
|
80
|
+
"end": new Date("2019-01-13").getTime(),
|
|
81
|
+
"color": colorSet.getIndex(0),
|
|
82
|
+
"task": "Gathering requirements"
|
|
83
|
+
}, {
|
|
84
|
+
"category": "Module #1",
|
|
85
|
+
"start": new Date("2019-02-05").getTime(),
|
|
86
|
+
"end": new Date("2019-04-18").getTime(),
|
|
87
|
+
"color": colorSet.getIndex(0),
|
|
88
|
+
"task": "Development"
|
|
89
|
+
}, {
|
|
90
|
+
"category": "Module #2",
|
|
91
|
+
"start": new Date("2019-01-08").getTime(),
|
|
92
|
+
"end": new Date("2019-01-10").getTime(),
|
|
93
|
+
"color": colorSet.getIndex(5),
|
|
94
|
+
"task": "Gathering requirements"
|
|
95
|
+
}, {
|
|
96
|
+
"category": "Module #2",
|
|
97
|
+
"start": new Date("2019-01-12").getTime(),
|
|
98
|
+
"end": new Date("2019-01-15").getTime(),
|
|
99
|
+
"color": colorSet.getIndex(5),
|
|
100
|
+
"task": "Producing specifications"
|
|
101
|
+
}, {
|
|
102
|
+
"category": "Module #2",
|
|
103
|
+
"start": new Date("2019-01-16").getTime(),
|
|
104
|
+
"end": new Date("2019-02-05").getTime(),
|
|
105
|
+
"color": colorSet.getIndex(5),
|
|
106
|
+
"task": "Development"
|
|
107
|
+
}, {
|
|
108
|
+
"category": "Module #2",
|
|
109
|
+
"start": new Date("2019-02-10").getTime(),
|
|
110
|
+
"end": new Date("2019-02-18").getTime(),
|
|
111
|
+
"color": colorSet.getIndex(5),
|
|
112
|
+
"task": "Testing and QA"
|
|
113
|
+
}, {
|
|
114
|
+
"category": ""
|
|
115
|
+
}, {
|
|
116
|
+
"category": "Module #3",
|
|
117
|
+
"start": new Date("2019-01-01").getTime(),
|
|
118
|
+
"end": new Date("2019-01-19").getTime(),
|
|
119
|
+
"color": colorSet.getIndex(9),
|
|
120
|
+
"task": "Gathering requirements"
|
|
121
|
+
}, {
|
|
122
|
+
"category": "Module #3",
|
|
123
|
+
"start": new Date("2019-02-01").getTime(),
|
|
124
|
+
"end": new Date("2019-02-10").getTime(),
|
|
125
|
+
"color": colorSet.getIndex(9),
|
|
126
|
+
"task": "Producing specifications"
|
|
127
|
+
}, {
|
|
128
|
+
"category": "Module #3",
|
|
129
|
+
"start": new Date("2019-03-10").getTime(),
|
|
130
|
+
"end": new Date("2019-04-15").getTime(),
|
|
131
|
+
"color": colorSet.getIndex(9),
|
|
132
|
+
"task": "Development"
|
|
133
|
+
}, {
|
|
134
|
+
"category": "Module #3",
|
|
135
|
+
"start": new Date("2019-04-20").getTime(),
|
|
136
|
+
"end": new Date("2019-04-30").getTime(),
|
|
137
|
+
"color": colorSet.getIndex(9),
|
|
138
|
+
"task": "Testing and QA",
|
|
139
|
+
"disabled2": false,
|
|
140
|
+
"image2": "/wp-content/uploads/assets/timeline/rachel.jpg",
|
|
141
|
+
"location": 0
|
|
142
|
+
}, {
|
|
143
|
+
"category": "Module #4",
|
|
144
|
+
"start": new Date("2019-01-15").getTime(),
|
|
145
|
+
"end": new Date("2019-02-12").getTime(),
|
|
146
|
+
"color": colorSet.getIndex(15),
|
|
147
|
+
"task": "Gathering requirements",
|
|
148
|
+
"disabled1": false,
|
|
149
|
+
"image1": "/wp-content/uploads/assets/timeline/monica.jpg"
|
|
150
|
+
}, {
|
|
151
|
+
"category": "Module #4",
|
|
152
|
+
"start": new Date("2019-02-25").getTime(),
|
|
153
|
+
"end": new Date("2019-03-10").getTime(),
|
|
154
|
+
"color": colorSet.getIndex(15),
|
|
155
|
+
"task": "Development"
|
|
156
|
+
}, {
|
|
157
|
+
"category": "Module #4",
|
|
158
|
+
"start": new Date("2019-03-23").getTime(),
|
|
159
|
+
"end": new Date("2019-04-29").getTime(),
|
|
160
|
+
"color": colorSet.getIndex(15),
|
|
161
|
+
"task": "Testing and QA"
|
|
162
|
+
}];
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
// Add series
|
|
166
|
+
// https://www.amcharts.com/docs/v5/charts/xy-chart/series/
|
|
167
|
+
const series = chart.series.push(am5timeline.CurveColumnSeries.new(root, {
|
|
168
|
+
xAxis: xAxis,
|
|
169
|
+
yAxis: yAxis,
|
|
170
|
+
baseAxis: yAxis,
|
|
171
|
+
valueXField: "end",
|
|
172
|
+
openValueXField: "start",
|
|
173
|
+
categoryYField: "category",
|
|
174
|
+
layer: 30
|
|
175
|
+
}));
|
|
176
|
+
|
|
177
|
+
series.columns.template.setAll({
|
|
178
|
+
height: am5.percent(10),
|
|
179
|
+
strokeOpacity: 0
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
series.bullets.push(function(root, series, dataItem) {
|
|
183
|
+
const circle = am5.Circle.new(root, {
|
|
184
|
+
radius: 4,
|
|
185
|
+
fill: chart.get("colors").getIndex(series.dataItems.indexOf(dataItem)),
|
|
186
|
+
strokeWidth: 2,
|
|
187
|
+
strokeOpacity: 0.5,
|
|
188
|
+
layer: 30
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
return am5.Bullet.new(root, {
|
|
192
|
+
sprite: circle,
|
|
193
|
+
locationX: 0,
|
|
194
|
+
locationY: 0.5
|
|
195
|
+
})
|
|
196
|
+
})
|
|
197
|
+
|
|
198
|
+
series.bullets.push(function(root, series, dataItem) {
|
|
199
|
+
const circle = am5.Circle.new(root, {
|
|
200
|
+
radius: 4,
|
|
201
|
+
fill: chart.get("colors").getIndex(series.dataItems.indexOf(dataItem)),
|
|
202
|
+
strokeWidth: 2,
|
|
203
|
+
strokeOpacity: 0.5,
|
|
204
|
+
layer: 30
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
return am5.Bullet.new(root, {
|
|
208
|
+
sprite: circle, locationX: 1
|
|
209
|
+
})
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
series.columns.template.adapters.add("fill", function(fill, target) {
|
|
213
|
+
return chart.get("colors").getIndex(series.dataItems.indexOf(target.dataItem));
|
|
214
|
+
})
|
|
215
|
+
|
|
216
|
+
// line series for flags
|
|
217
|
+
const lineSeries = chart.series.push(am5timeline.CurveLineSeries.new(root, {
|
|
218
|
+
xAxis: xAxis, yAxis: yAxis, categoryYField: "category", valueXField: "date"
|
|
219
|
+
}));
|
|
220
|
+
|
|
221
|
+
lineSeries.strokes.template.set("forceHidden", true);
|
|
222
|
+
|
|
223
|
+
lineSeries.bullets.push(function(root, series, dataItem) {
|
|
224
|
+
const flag = am5.Tooltip.new(root, {
|
|
225
|
+
centerY: 28,
|
|
226
|
+
paddingBottom: 4, paddingLeft: 7, paddingRight: 7, paddingTop: 4, layer: 30
|
|
227
|
+
})
|
|
228
|
+
|
|
229
|
+
flag.get("background")?.setAll({
|
|
230
|
+
stroke: am5.color(0x000000), cornerRadius: 0
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
flag.label.setAll({
|
|
234
|
+
fill: am5.color(0x000000),
|
|
235
|
+
text: dataItem.dataContext.letter,
|
|
236
|
+
fontSize: "0.8em"
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
flag.show();
|
|
240
|
+
|
|
241
|
+
return am5.Bullet.new(root, {
|
|
242
|
+
sprite: flag,
|
|
243
|
+
locationX: 0.5, locationY: 0.5
|
|
244
|
+
})
|
|
245
|
+
})
|
|
246
|
+
|
|
247
|
+
lineSeries.data.setAll([{ category: "", eventDate: "2019-01-15", letter: "A", description: "Something happened here" },
|
|
248
|
+
{ category: "", date: new Date("2019-01-23").getTime(), letter: "B", description: "Something happened here" },
|
|
249
|
+
{ category: "", date: new Date("2019-02-10").getTime(), letter: "C", description: "Something happened here" },
|
|
250
|
+
{ category: "", date: new Date("2019-02-29").getTime(), letter: "D", description: "Something happened here" },
|
|
251
|
+
{ category: "", date: new Date("2019-03-06").getTime(), letter: "E", description: "Something happened here" },
|
|
252
|
+
{ category: "", date: new Date("2019-03-12").getTime(), letter: "F", description: "Something happened here" },
|
|
253
|
+
{ category: "", date: new Date("2019-03-22").getTime(), letter: "G", description: "Something happened here" }])
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
const cursor = chart.set("cursor", am5timeline.CurveCursor.new(root, {
|
|
257
|
+
behavior: "zoomX",
|
|
258
|
+
xAxis: xAxis,
|
|
259
|
+
yAxis: yAxis
|
|
260
|
+
}));
|
|
261
|
+
|
|
262
|
+
series.data.setAll(data);
|
|
263
|
+
yAxis.data.setAll([{ category: "Module #1" }, { category: "Module #2" }, { category: "" }, { category: "Module #3" }, { category: "Module #4" }]);
|
|
264
|
+
|
|
265
|
+
// Animate chart and series in
|
|
266
|
+
// https://www.amcharts.com/docs/v5/concepts/animations/#Initial_animation
|
|
267
|
+
series.appear(1000);
|
|
268
|
+
chart.appear(1000, 100);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"private": true,
|
|
3
|
+
"name": "amcharts5-example-timeline-horizontal-serpentine-chart",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"devDependencies": {
|
|
6
|
+
"@amcharts/amcharts5": "^5.12.0",
|
|
7
|
+
"source-map-loader": "^4.0.1",
|
|
8
|
+
"webpack": "^5.1.3",
|
|
9
|
+
"webpack-cli": "^5.1.1",
|
|
10
|
+
"webpack-dev-server": "^4.15.0"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "webpack",
|
|
14
|
+
"start": "webpack serve --mode development"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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.js",
|
|
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.join(__dirname, "dist"),
|
|
26
|
+
publicPath: "dist/",
|
|
27
|
+
filename: "[name].js",
|
|
28
|
+
chunkFilename: "[name].js"
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
module: {
|
|
32
|
+
rules: [{
|
|
33
|
+
test: /.js$/,
|
|
34
|
+
use: ["source-map-loader"],
|
|
35
|
+
enforce: "pre"
|
|
36
|
+
}]
|
|
37
|
+
}
|
|
38
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
body {
|
|
2
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
3
|
+
padding: 0;
|
|
4
|
+
margin: 0;
|
|
5
|
+
background-color: #ffffff;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
#chartdiv {
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 80vh;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<title>amCharts 5 Example - timeline-linear-process-diagram</title>
|
|
6
|
+
<link rel="stylesheet" href="index.css" />
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="chartdiv"></div>
|
|
10
|
+
<script src="dist/index.js"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|