Draggable Range with a Close Button
A stop-loss line you can move: drag the box up or down and the value in it follows. Click the X and the line is gone.
About this chart
When to let people drag a line
A draggable line turns a threshold into something people set themselves: a stop-loss in a trading tool, an alert level on a monitoring screen, a limit in a budget planner. The value in the box updates as it moves, and your code can act on it.
Good for
- Trading tools: stop-loss and take-profit levels
- Alert thresholds people tune themselves
- What-if limits on a forecast
Think twice when
- A fixed limit nobody should change: draw it in code
- Exact values: offer an input box too, dragging is approximate
- Touch screens: make the box bigger, so a finger can grab it
For developers
Get the code.
Built with amCharts 5, a JavaScript library. The JavaScript includes your theme and renderer (canvas or SVG); the JSON also follows the changes you make with the controls.
For projects that use npm:
How it reads:
npm install @amcharts/amcharts5. See Getting started.
The same chart as a JSON config. Chart Maker reads and writes this format, the library's JSON parser turns it into a chart, and the <am5-chart> element puts it on a page with no code.How it reads:
"type" is the class to create and "settings" what you would pass to its new() in code; "properties" fill in its parts, lists such as series and axes or templates such as columns.template; "refs" holds objects used in more than one place ("#series-0" stands for the one named series-0); a string starting with "@" takes a value from another object, such as "@series.get('fill')".
A complete page. Save it as an .html file and open it in a browser.
Paste this into an AI coding assistant to build the chart from scratch. More in amCharts & AI.
// Create root element
// https://docs.amcharts.com/v5/getting-started/#root-element
var root = am5.Root.new("chartdiv");
// Set themes
// https://docs.amcharts.com/v5/concepts/themes/
root.setThemes([
am5themes_Animated.new(root),
am5themes_Responsive.new(root)
]);
// Create chart
// https://docs.amcharts.com/v5/charts/xy-chart/
var chart = root.container.children.push(am5xy.XYChart.new(root, {
panX: true, // drag the plot sideways to pan...
panY: true, // ...or up and down
wheelX: "panX", // a horizontal wheel or trackpad swipe pans...
wheelY: "zoomX", // ...and the vertical wheel zooms in on the dates
pinchZoomX: true, // pinch with two fingers to zoom on touch screens
paddingLeft: 0 // the value labels sit at the chart's left edge
}));
// Add cursor
// https://docs.amcharts.com/v5/charts/xy-chart/cursor/
var cursor = chart.set("cursor", am5xy.XYCursor.new(root, {}));
cursor.lineX.set("forceHidden", true); // no vertical cursor line...
cursor.lineY.set("forceHidden", true); // ...and no horizontal one: the cursor just shows the tooltip
// Generate random data
var date = new Date();
date.setHours(0, 0, 0, 0);
var value = 20;
// a random walk: each day moves a little from the day before, kept within 0 to 100
function generateData() {
value = am5.math.round(Math.random() * 10 - 4.8 + value, 1);
if (value < 0) {
value = am5.math.round(Math.random() * 10, 1);
}
if (value > 100) {
value = am5.math.round(100 - Math.random() * 10, 1);
}
am5.time.add(date, "day", 1);
return {
date: date.getTime(),
value: value
};
}
// count days of data in a row
function generateDatas(count) {
var data = [];
for (var i = 0; i < count; ++i) {
data.push(generateData());
}
return data;
}
// Create axes
// https://docs.amcharts.com/v5/charts/xy-chart/axes/
var xAxis = chart.xAxes.push(am5xy.DateAxis.new(root, {
baseInterval: { // one data point per day
timeUnit: "day",
count: 1
},
renderer: am5xy.AxisRendererX.new(root, {
minorGridEnabled: true, // faint grid lines between the main ones
minGridDistance: 90 // at least 90px between date labels
})
}));
var yAxis = chart.yAxes.push(am5xy.ValueAxis.new(root, {
renderer: am5xy.AxisRendererY.new(root, {})
}));
// Add series
// https://docs.amcharts.com/v5/charts/xy-chart/series/
var series = chart.series.push(am5xy.LineSeries.new(root, {
name: "Series",
xAxis: xAxis,
yAxis: yAxis,
valueYField: "value",
valueXField: "date",
tooltip: am5.Tooltip.new(root, {
labelText: "{valueY}" // the hovered value
})
}));
series.fills.template.setAll({
fillOpacity: 0.2, // a light fill under the line...
visible: true // ...switched on (line series fills are hidden by default)
});
// Add scrollbar
// https://docs.amcharts.com/v5/charts/xy-chart/scrollbars/
chart.set("scrollbarX", am5.Scrollbar.new(root, {
orientation: "horizontal" // a scrollbar above the plot, to zoom and pan the dates
}));
// DRAGGABLE RANGE
// add series range
var rangeDataItem = yAxis.makeDataItem({});
yAxis.createAxisRange(rangeDataItem);
// create container for all elements, you can put anything you want in it
var container = am5.Container.new(root, {
// the box is centered vertically on the range line
centerY: am5.p50,
draggable: true, // the box can be dragged (up and down only, see the adapters below)
layout: root.horizontalLayout // the label and the X button side by side
})
// restrict from being dragged horizontally: the box stays at the value axis's side of the plot
container.adapters.add("x", function() {
if (yAxis.get("renderer").get("opposite")) {
return chart.plotContainer.width() - container.width(); // the axis on the right: at the right edge
}
return 0; // at the left edge
});
// restrict from being dragged outside of plot
container.adapters.add("y", function(y) {
return Math.max(0, Math.min(chart.plotContainer.height(), y));
});
// change range when y changes
container.events.on("dragged", function() {
updateLabel();
});
// this is needed for the bullets to be interactive, above the plot
yAxis.topGridContainer.children.push(container);
// create bullet and set container as a bullets sprite
rangeDataItem.set("bullet", am5xy.AxisBullet.new(root, {
sprite: container
}));
// the range's color: the theme's warning red ("negative"), so it suits every theme and dark mode
var rangeColor = root.interfaceColors.get("negative");
// decorate grid of a range: a dashed line, the same color as the box around the label
rangeDataItem.get("grid").setAll({
strokeOpacity: 1,
visible: true,
stroke: rangeColor,
strokeDasharray: [2, 2]
})
// create background for the container, in the chart's background color (white, or dark in dark mode)
var background = am5.RoundedRectangle.new(root, {
fill: root.interfaceColors.get("background"),
fillOpacity: 1, // opaque, so the chart doesn't show through the box
strokeOpacity: 0.5, // the outline half transparent
cornerRadiusTL: 0, // square left corners, flush with the axis...
cornerRadiusBL: 0, // ...the right ones stay rounded
cursorOverStyle: "ns-resize", // an up-down arrow pointer over the box
stroke: rangeColor // the range line's color
})
container.set("background", background);
// with the value axis on the right, the box moves to the right edge and squares its right corners instead
yAxis.get("renderer").on("opposite", function(opposite) {
background.setAll({
cornerRadiusTL: opposite ? 8 : 0, // 8px, the theme's rounding, away from the axis
cornerRadiusBL: opposite ? 8 : 0,
cornerRadiusTR: opposite ? 0 : 8,
cornerRadiusBR: opposite ? 0 : 8
});
container.markDirtyPosition(); // places the box again, through the x adapter above
});
// add label to container, this one will show value and text
var label = container.children.push(am5.Label.new(root, {
paddingTop: 5, // 5px of space above...
paddingBottom: 5 // ...and below the text
}))
// add x button
var xButton = container.children.push(am5.Button.new(root, {
cursorOverStyle: "pointer", // a hand pointer over the button
paddingTop: 5, // the same height as the label...
paddingBottom: 5,
paddingLeft: 2, // ...close to it on the left, with some room on the right
paddingRight: 8
}))
// add label to the button (you can add icon instead of a label)
xButton.set("label", am5.Label.new(root, {
text: "X",
paddingBottom: 0, // no padding around the X
paddingTop: 0,
paddingRight: 0,
paddingLeft: 0,
fill: rangeColor // an X in the range's color
}))
// modify background of x button
xButton.get("background").setAll({
strokeOpacity: 0, // no outline...
fillOpacity: 0 // ...and no fill: only the red X shows
})
// dispose item when x button is clicked
xButton.events.on("click", function() {
yAxis.disposeDataItem(rangeDataItem);
})
// reads the value at the box's height (zoom included), shows it and moves the range line there
function updateLabel(value) {
var y = container.y();
var position = yAxis.toAxisPosition(y / chart.plotContainer.height());
if(value == null){
value = yAxis.positionToValue(position);
}
label.set("text", "Stop loss: " + root.numberFormatter.format(value, "#.00")); // always two decimals
rangeDataItem.set("value", value);
}
// when data is validated, set range value to the middle
series.events.on("datavalidated", () => {
var max = yAxis.getPrivate("max", 1);
var min = yAxis.getPrivate("min", 0);
var value = min + (max - min) / 2;
rangeDataItem.set("value", value);
updateLabel(value);
})
// Set data
var data = generateDatas(300);
series.data.setAll(data);
// Make stuff animate on load
// https://docs.amcharts.com/v5/concepts/animations/
series.appear(1000);
chart.appear(1000, 100);
{
"type": "XYChart",
"settings": {
"panX": true,
"panY": true,
"wheelX": "panX",
"wheelY": "zoomX",
"pinchZoomX": true,
"paddingLeft": 0,
"cursor": {
"type": "XYCursor",
"properties": {
"lineX": {
"settings": {
"forceHidden": true
}
},
"lineY": {
"settings": {
"forceHidden": true
}
}
}
},
"scrollbarX": {
"type": "Scrollbar",
"settings": {
"orientation": "horizontal"
}
}
},
"properties": {
"series": [
"#series-0"
],
"xAxes": [
"#axis-0"
],
"yAxes": [
"#axis-1"
]
},
"refs": [
{
"data-0": [
{
"date": 1792011600000,
"value": 24.8
},
{
"date": 1792098000000,
"value": 27.6
},
{
"date": 1792184400000,
"value": 28
},
{
"date": 1792270800000,
"value": 29.3
},
{
"date": 1792357200000,
"value": 28.5
},
{
"date": 1792443600000,
"value": 25.4
},
{
"date": 1792530000000,
"value": 25.4
},
{
"date": 1792616400000,
"value": 30.1
},
{
"date": 1792702800000,
"value": 34.2
},
{
"date": 1792789200000,
"value": 36.3
},
{
"date": 1792875600000,
"value": 31.7
},
{
"date": 1792965600000,
"value": 33.2
},
{
"date": 1793052000000,
"value": 37.5
},
{
"date": 1793138400000,
"value": 34.9
},
{
"date": 1793224800000,
"value": 37.2
},
{
"date": 1793311200000,
"value": 33.7
},
{
"date": 1793397600000,
"value": 32.8
},
{
"date": 1793484000000,
"value": 34
},
{
"date": 1793570400000,
"value": 37.6
},
{
"date": 1793656800000,
"value": 40.5
},
{
"date": 1793743200000,
"value": 39.3
},
{
"date": 1793829600000,
"value": 36.4
},
{
"date": 1793916000000,
"value": 38.4
},
{
"date": 1794002400000,
"value": 38.4
},
{
"date": 1794088800000,
"value": 42.7
},
{
"date": 1794175200000,
"value": 45.5
},
{
"date": 1794261600000,
"value": 40.8
},
{
"date": 1794348000000,
"value": 36
},
{
"date": 1794434400000,
"value": 40.6
},
{
"date": 1794520800000,
"value": 41.7
},
{
"date": 1794607200000,
"value": 45.2
},
{
"date": 1794693600000,
"value": 43.1
},
{
"date": 1794780000000,
"value": 44.7
},
{
"date": 1794866400000,
"value": 47.4
},
{
"date": 1794952800000,
"value": 51.7
},
{
"date": 1795039200000,
"value": 49.5
},
{
"date": 1795125600000,
"value": 49.2
},
{
"date": 1795212000000,
"value": 50.6
},
{
"date": 1795298400000,
"value": 49.2
},
{
"date": 1795384800000,
"value": 47.3
},
{
"date": 1795471200000,
"value": 46.9
},
{
"date": 1795557600000,
"value": 47.2
},
{
"date": 1795644000000,
"value": 47
},
{
"date": 1795730400000,
"value": 45.8
},
{
"date": 1795816800000,
"value": 44
},
{
"date": 1795903200000,
"value": 44.1
},
{
"date": 1795989600000,
"value": 40.9
},
{
"date": 1796076000000,
"value": 36.4
},
{
"date": 1796162400000,
"value": 34.6
},
{
"date": 1796248800000,
"value": 33.7
},
{
"date": 1796335200000,
"value": 38.6
},
{
"date": 1796421600000,
"value": 36.6
},
{
"date": 1796508000000,
"value": 38.2
},
{
"date": 1796594400000,
"value": 36.4
},
{
"date": 1796680800000,
"value": 41.2
},
{
"date": 1796767200000,
"value": 36.7
},
{
"date": 1796853600000,
"value": 38.5
},
{
"date": 1796940000000,
"value": 40.3
},
{
"date": 1797026400000,
"value": 42.3
},
{
"date": 1797112800000,
"value": 45.7
},
{
"date": 1797199200000,
"value": 43
},
{
"date": 1797285600000,
"value": 40
},
{
"date": 1797372000000,
"value": 35.8
},
{
"date": 1797458400000,
"value": 40.7
},
{
"date": 1797544800000,
"value": 41.1
},
{
"date": 1797631200000,
"value": 37.8
},
{
"date": 1797717600000,
"value": 40.8
},
{
"date": 1797804000000,
"value": 38
},
{
"date": 1797890400000,
"value": 38.3
},
{
"date": 1797976800000,
"value": 41.7
},
{
"date": 1798063200000,
"value": 41.4
},
{
"date": 1798149600000,
"value": 37.7
},
{
"date": 1798236000000,
"value": 37.7
},
{
"date": 1798322400000,
"value": 40.4
},
{
"date": 1798408800000,
"value": 36.4
},
{
"date": 1798495200000,
"value": 34.4
},
{
"date": 1798581600000,
"value": 38.5
},
{
"date": 1798668000000,
"value": 39.2
},
{
"date": 1798754400000,
"value": 41.5
},
{
"date": 1798840800000,
"value": 39.4
},
{
"date": 1798927200000,
"value": 40.8
},
{
"date": 1799013600000,
"value": 36.8
},
{
"date": 1799100000000,
"value": 41.3
},
{
"date": 1799186400000,
"value": 39.4
},
{
"date": 1799272800000,
"value": 38
},
{
"date": 1799359200000,
"value": 33.5
},
{
"date": 1799445600000,
"value": 34.1
},
{
"date": 1799532000000,
"value": 33.1
},
{
"date": 1799618400000,
"value": 31.4
},
{
"date": 1799704800000,
"value": 27
},
{
"date": 1799791200000,
"value": 29.2
},
{
"date": 1799877600000,
"value": 26.4
},
{
"date": 1799964000000,
"value": 30.5
},
{
"date": 1800050400000,
"value": 28.7
},
{
"date": 1800136800000,
"value": 31.4
},
{
"date": 1800223200000,
"value": 29.7
},
{
"date": 1800309600000,
"value": 30.4
},
{
"date": 1800396000000,
"value": 25.9
},
{
"date": 1800482400000,
"value": 29
},
{
"date": 1800568800000,
"value": 28.4
},
{
"date": 1800655200000,
"value": 26.7
},
{
"date": 1800741600000,
"value": 25.1
},
{
"date": 1800828000000,
"value": 27
},
{
"date": 1800914400000,
"value": 25.2
},
{
"date": 1801000800000,
"value": 28.2
},
{
"date": 1801087200000,
"value": 25.1
},
{
"date": 1801173600000,
"value": 22.7
},
{
"date": 1801260000000,
"value": 27.1
},
{
"date": 1801346400000,
"value": 26.3
},
{
"date": 1801432800000,
"value": 28
},
{
"date": 1801519200000,
"value": 24.1
},
{
"date": 1801605600000,
"value": 23.3
},
{
"date": 1801692000000,
"value": 23.1
},
{
"date": 1801778400000,
"value": 25.9
},
{
"date": 1801864800000,
"value": 30.5
},
{
"date": 1801951200000,
"value": 26.7
},
{
"date": 1802037600000,
"value": 28.1
},
{
"date": 1802124000000,
"value": 30.8
},
{
"date": 1802210400000,
"value": 26.5
},
{
"date": 1802296800000,
"value": 29
},
{
"date": 1802383200000,
"value": 34.1
},
{
"date": 1802469600000,
"value": 38
},
{
"date": 1802556000000,
"value": 40.7
},
{
"date": 1802642400000,
"value": 37.8
},
{
"date": 1802728800000,
"value": 42.2
},
{
"date": 1802815200000,
"value": 44.9
},
{
"date": 1802901600000,
"value": 45.6
},
{
"date": 1802988000000,
"value": 42.8
},
{
"date": 1803074400000,
"value": 39.6
},
{
"date": 1803160800000,
"value": 36.4
},
{
"date": 1803247200000,
"value": 33.5
},
{
"date": 1803333600000,
"value": 34.3
},
{
"date": 1803420000000,
"value": 34.4
},
{
"date": 1803506400000,
"value": 37.5
},
{
"date": 1803592800000,
"value": 40.2
},
{
"date": 1803679200000,
"value": 36.6
},
{
"date": 1803765600000,
"value": 38.7
},
{
"date": 1803852000000,
"value": 42.9
},
{
"date": 1803938400000,
"value": 47.4
},
{
"date": 1804024800000,
"value": 43.6
},
{
"date": 1804111200000,
"value": 40.2
},
{
"date": 1804197600000,
"value": 37.6
},
{
"date": 1804284000000,
"value": 38.6
},
{
"date": 1804370400000,
"value": 34.6
},
{
"date": 1804456800000,
"value": 37.4
},
{
"date": 1804543200000,
"value": 34.3
},
{
"date": 1804629600000,
"value": 34.9
},
{
"date": 1804716000000,
"value": 35.5
},
{
"date": 1804802400000,
"value": 31.3
},
{
"date": 1804888800000,
"value": 29.7
},
{
"date": 1804975200000,
"value": 25.2
},
{
"date": 1805061600000,
"value": 22.1
},
{
"date": 1805148000000,
"value": 25.5
},
{
"date": 1805234400000,
"value": 30.4
},
{
"date": 1805320800000,
"value": 27.3
},
{
"date": 1805407200000,
"value": 26.4
},
{
"date": 1805493600000,
"value": 23.2
},
{
"date": 1805580000000,
"value": 27.6
},
{
"date": 1805666400000,
"value": 28.7
},
{
"date": 1805752800000,
"value": 26.4
},
{
"date": 1805839200000,
"value": 26.8
},
{
"date": 1805925600000,
"value": 22.7
},
{
"date": 1806012000000,
"value": 27.5
},
{
"date": 1806098400000,
"value": 27.4
},
{
"date": 1806184800000,
"value": 29
},
{
"date": 1806267600000,
"value": 26.6
},
{
"date": 1806354000000,
"value": 25.9
},
{
"date": 1806440400000,
"value": 21.6
},
{
"date": 1806526800000,
"value": 22.8
},
{
"date": 1806613200000,
"value": 23
},
{
"date": 1806699600000,
"value": 23.3
},
{
"date": 1806786000000,
"value": 28.1
},
{
"date": 1806872400000,
"value": 29.8
},
{
"date": 1806958800000,
"value": 26
},
{
"date": 1807045200000,
"value": 28.4
},
{
"date": 1807131600000,
"value": 29
},
{
"date": 1807218000000,
"value": 25.2
},
{
"date": 1807304400000,
"value": 21.1
},
{
"date": 1807390800000,
"value": 17.9
},
{
"date": 1807477200000,
"value": 13.5
},
{
"date": 1807563600000,
"value": 17.8
},
{
"date": 1807650000000,
"value": 21.6
},
{
"date": 1807736400000,
"value": 19.9
},
{
"date": 1807822800000,
"value": 23.9
},
{
"date": 1807909200000,
"value": 27.2
},
{
"date": 1807995600000,
"value": 27.3
},
{
"date": 1808082000000,
"value": 25.6
},
{
"date": 1808168400000,
"value": 22.2
},
{
"date": 1808254800000,
"value": 23.5
},
{
"date": 1808341200000,
"value": 23.6
},
{
"date": 1808427600000,
"value": 19.6
},
{
"date": 1808514000000,
"value": 23.1
},
{
"date": 1808600400000,
"value": 22.7
},
{
"date": 1808686800000,
"value": 20.3
},
{
"date": 1808773200000,
"value": 19.2
},
{
"date": 1808859600000,
"value": 21.6
},
{
"date": 1808946000000,
"value": 20.2
},
{
"date": 1809032400000,
"value": 16.4
},
{
"date": 1809118800000,
"value": 14.7
},
{
"date": 1809205200000,
"value": 14
},
{
"date": 1809291600000,
"value": 17.1
},
{
"date": 1809378000000,
"value": 19.3
},
{
"date": 1809464400000,
"value": 22.9
},
{
"date": 1809550800000,
"value": 20.1
},
{
"date": 1809637200000,
"value": 23.7
},
{
"date": 1809723600000,
"value": 23.1
},
{
"date": 1809810000000,
"value": 20.1
},
{
"date": 1809896400000,
"value": 21.3
},
{
"date": 1809982800000,
"value": 17.5
},
{
"date": 1810069200000,
"value": 20.3
},
{
"date": 1810155600000,
"value": 18.4
},
{
"date": 1810242000000,
"value": 15.8
},
{
"date": 1810328400000,
"value": 16.6
},
{
"date": 1810414800000,
"value": 17.4
},
{
"date": 1810501200000,
"value": 19.1
},
{
"date": 1810587600000,
"value": 15
},
{
"date": 1810674000000,
"value": 13
},
{
"date": 1810760400000,
"value": 18.2
},
{
"date": 1810846800000,
"value": 18.6
},
{
"date": 1810933200000,
"value": 17.5
},
{
"date": 1811019600000,
"value": 15.9
},
{
"date": 1811106000000,
"value": 13.3
},
{
"date": 1811192400000,
"value": 16.4
},
{
"date": 1811278800000,
"value": 16.3
},
{
"date": 1811365200000,
"value": 19.6
},
{
"date": 1811451600000,
"value": 17.4
},
{
"date": 1811538000000,
"value": 14.3
},
{
"date": 1811624400000,
"value": 11.6
},
{
"date": 1811710800000,
"value": 13.9
},
{
"date": 1811797200000,
"value": 15.3
},
{
"date": 1811883600000,
"value": 11.3
},
{
"date": 1811970000000,
"value": 13.1
},
{
"date": 1812056400000,
"value": 9
},
{
"date": 1812142800000,
"value": 10.4
},
{
"date": 1812229200000,
"value": 6.9
},
{
"date": 1812315600000,
"value": 7.3
},
{
"date": 1812402000000,
"value": 10.8
},
{
"date": 1812488400000,
"value": 9.9
},
{
"date": 1812574800000,
"value": 14.7
},
{
"date": 1812661200000,
"value": 17.5
},
{
"date": 1812747600000,
"value": 17.1
},
{
"date": 1812834000000,
"value": 16.8
},
{
"date": 1812920400000,
"value": 15.1
},
{
"date": 1813006800000,
"value": 17.5
},
{
"date": 1813093200000,
"value": 20.2
},
{
"date": 1813179600000,
"value": 24.2
},
{
"date": 1813266000000,
"value": 22.5
},
{
"date": 1813352400000,
"value": 22.8
},
{
"date": 1813438800000,
"value": 26.1
},
{
"date": 1813525200000,
"value": 24.7
},
{
"date": 1813611600000,
"value": 24
},
{
"date": 1813698000000,
"value": 20.1
},
{
"date": 1813784400000,
"value": 17
},
{
"date": 1813870800000,
"value": 22
},
{
"date": 1813957200000,
"value": 26.6
},
{
"date": 1814043600000,
"value": 29.5
},
{
"date": 1814130000000,
"value": 30.2
},
{
"date": 1814216400000,
"value": 34.9
},
{
"date": 1814302800000,
"value": 31.6
},
{
"date": 1814389200000,
"value": 35.2
},
{
"date": 1814475600000,
"value": 36.2
},
{
"date": 1814562000000,
"value": 34.5
},
{
"date": 1814648400000,
"value": 31.2
},
{
"date": 1814734800000,
"value": 27.1
},
{
"date": 1814821200000,
"value": 28.8
},
{
"date": 1814907600000,
"value": 33.5
},
{
"date": 1814994000000,
"value": 36.3
},
{
"date": 1815080400000,
"value": 36.2
},
{
"date": 1815166800000,
"value": 35
},
{
"date": 1815253200000,
"value": 35.8
},
{
"date": 1815339600000,
"value": 40
},
{
"date": 1815426000000,
"value": 39.2
},
{
"date": 1815512400000,
"value": 43.8
},
{
"date": 1815598800000,
"value": 47.2
},
{
"date": 1815685200000,
"value": 43.3
},
{
"date": 1815771600000,
"value": 38.9
},
{
"date": 1815858000000,
"value": 38.1
},
{
"date": 1815944400000,
"value": 35.1
},
{
"date": 1816030800000,
"value": 39.2
},
{
"date": 1816117200000,
"value": 41.9
},
{
"date": 1816203600000,
"value": 43
},
{
"date": 1816290000000,
"value": 38.9
},
{
"date": 1816376400000,
"value": 37.9
},
{
"date": 1816462800000,
"value": 36.3
},
{
"date": 1816549200000,
"value": 40
},
{
"date": 1816635600000,
"value": 38.8
},
{
"date": 1816722000000,
"value": 37.4
},
{
"date": 1816808400000,
"value": 33
},
{
"date": 1816894800000,
"value": 33.9
},
{
"date": 1816981200000,
"value": 35.5
},
{
"date": 1817067600000,
"value": 31
},
{
"date": 1817154000000,
"value": 34
},
{
"date": 1817240400000,
"value": 33.1
},
{
"date": 1817326800000,
"value": 28.8
},
{
"date": 1817413200000,
"value": 24.6
},
{
"date": 1817499600000,
"value": 26.3
},
{
"date": 1817586000000,
"value": 31.3
},
{
"date": 1817672400000,
"value": 27.2
},
{
"date": 1817758800000,
"value": 24.5
},
{
"date": 1817845200000,
"value": 26.6
}
]
},
{
"axis-0": {
"type": "DateAxis",
"settings": {
"baseInterval": {
"timeUnit": "day",
"count": 1
},
"renderer": {
"type": "AxisRendererX",
"settings": {
"minorGridEnabled": true,
"minGridDistance": 90
}
}
}
}
},
{
"axis-1": {
"type": "ValueAxis",
"settings": {
"renderer": {
"type": "AxisRendererY"
}
}
}
},
{
"series-0": {
"type": "LineSeries",
"settings": {
"name": "Series",
"xAxis": "#axis-0",
"yAxis": "#axis-1",
"valueYField": "value",
"valueXField": "date",
"tooltip": {
"type": "Tooltip",
"settings": {
"labelText": "{valueY}"
}
}
},
"properties": {
"data": "#data-0",
"fills": {
"properties": {
"template": {
"settings": {
"fillOpacity": 0.2,
"visible": true
}
}
}
}
}
}
},
{
"axisRange-0": {
"axis": "#axis-1",
"settings": {
"grid": {
"type": "Grid",
"settings": {
"strokeOpacity": 1,
"stroke": "@root.interfaceColors.get('negative')",
"visible": true,
"strokeDasharray": [2, 2]
}
},
"bullet": {
"type": "AxisBullet",
"settings": {
"sprite": {
"type": "Container",
"settings": {
"centerY": {
"type": "Percent",
"value": 50
},
"draggable": true,
"layout": {
"type": "HorizontalLayout"
},
"background": {
"type": "RoundedRectangle",
"settings": {
"fill": "@root.interfaceColors.get('background')",
"fillOpacity": 1,
"strokeOpacity": 0.5,
"cornerRadiusTL": 0,
"cornerRadiusBL": 0,
"cursorOverStyle": "ns-resize",
"stroke": "@root.interfaceColors.get('negative')"
}
}
}
}
}
},
"value": 30
},
"__parseLogic": "axisRange"
}
}
]
}



