mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-22 00:40:22 +02:00
fix missing values
This commit is contained in:
@@ -67,7 +67,7 @@
|
||||
title "Basic xychart with multiple datasets"
|
||||
x-axis "Relevant categories" [category1, "category 2", category3, category4]
|
||||
y-axis Animals 0 --> 160
|
||||
bar "dogs" [40, 20, 40, 30]
|
||||
bar "dogs" [0, 60, 40, 30]
|
||||
bar "cats" [20, 40, 50, 30]
|
||||
bar "birds" [30, 60, 50, 30]
|
||||
</pre>
|
||||
@@ -78,7 +78,7 @@
|
||||
title "Basic xychart with multiple datasets"
|
||||
x-axis "Relevant categories" [category1, "category 2", category3, category4]
|
||||
y-axis Animals 0 --> 160
|
||||
bar "dogs" [40, 20, 40, 30]
|
||||
bar "dogs" [0, 60, 40, 30]
|
||||
bar "cats" [20, 40, 50, 30]
|
||||
bar "birds" [30, 60, 50, 30]
|
||||
</pre>
|
||||
|
@@ -137,7 +137,7 @@ function transformDataWithoutCategory(data: number[]): SimplePlotDataType {
|
||||
}
|
||||
|
||||
if (isBandAxisData(xyChartData.xAxis)) {
|
||||
retData = xyChartData.xAxis.categories.map((c, i) => [c, data[i]]);
|
||||
retData = xyChartData.xAxis.categories.map((c, i) => [c, data[i] ?? 0]);
|
||||
}
|
||||
|
||||
if (isLinearAxisData(xyChartData.xAxis)) {
|
||||
@@ -148,7 +148,7 @@ function transformDataWithoutCategory(data: number[]): SimplePlotDataType {
|
||||
for (let i = min; i <= max; i += step) {
|
||||
categories.push(`${i}`);
|
||||
}
|
||||
retData = categories.map((c, i) => [c, data[i]]);
|
||||
retData = categories.map((c, i) => [c, data[i] ?? 0]);
|
||||
}
|
||||
|
||||
return retData;
|
||||
|
Reference in New Issue
Block a user