Files
redash/client/app/visualizations/chart/plotly/fixtures/prepareData/line-area/keep-missing-values.json
Levko Kravets 2c98f0425d Allow the user to decide how to handle null values in charts (#4071)
* getredash/redash#2629 Refactor Chart visualization, add option for handling NULL values (keep/convert to 0.0)

* Handle null values in line/area stacking code; some cleanup

* Handle edge case: line/area stacking when last value of one of series is missing

* Mjnor update to line/area stacking code

* Fix line/area normalize to percents feature

* Unit tests

* Refine tests; add tests for prepareLayout function

* Tests for prepareData (heatmap) function

* Tests for prepareData (pie) function

* Tests for prepareData (bar, line, area) function

* Tests for prepareData (scatter, bubble) function

* Tests for prepareData (box) function

* Remove unused file
2019-09-09 13:00:26 +03:00

78 lines
2.1 KiB
JSON

{
"input": {
"options": {
"globalSeriesType": "line",
"numberFormat": "0,0[.]00000",
"percentFormat": "0[.]00%",
"textFormat": "",
"showDataLabels": true,
"direction": { "type": "counterclockwise" },
"xAxis": { "type": "-", "labels": { "enabled": true } },
"yAxis": [
{ "type": "linear" },
{ "type": "linear", "opposite": true }
],
"series": { "stacking": "stack", "error_y": { "type": "data", "visible": true } },
"seriesOptions": {
"a": { "type": "line", "color": "red" },
"b": { "type": "line", "color": "blue" }
},
"columnMapping": {
"x": "x",
"y1": "y"
},
"missingValuesAsZero": false
},
"data": [
{
"name": "a",
"data": [
{ "x": "x1", "y": 10, "yError": 0 },
{ "x": "x2", "y": 20, "yError": 0 },
{ "x": "x3", "y": 30, "yError": 0 },
{ "x": "x4", "y": 40, "yError": 0 }
]
},
{
"name": "b",
"data": [
{ "x": "x2", "y": 2, "yError": 0 },
{ "x": "x4", "y": 4, "yError": 0 }
]
}
]
},
"output": {
"series": [
{
"visible": true,
"name": "a",
"mode": "lines+text",
"x": ["x1", "x2", "x3", "x4"],
"y": [10, 20, 30, 40],
"error_y": { "array": [0, 0, 0, 0], "color": "red" },
"hoverinfo": "text+x+name",
"hover": [],
"text": ["10 ± 0", "20 ± 0", "30 ± 0", "40 ± 0"],
"marker": { "color": "red" },
"insidetextfont": { "color": "#333333" },
"yaxis": "y"
},
{
"visible": true,
"name": "b",
"mode": "lines+text",
"x": ["x1", "x2", "x3", "x4"],
"y": [null, 22, null, 44],
"error_y": { "array": [null, 0, null, 0], "color": "blue" },
"hoverinfo": "text+x+name",
"hover": [],
"text": ["", "2 ± 0", "", "4 ± 0"],
"marker": { "color": "blue" },
"insidetextfont": { "color": "#333333" },
"yaxis": "y"
}
]
}
}