use float instead of int when reading Y axis json

This commit is contained in:
Jan Käberich 2021-10-30 20:41:07 +02:00
parent 57866ec7da
commit 583349e3ec

View File

@ -192,9 +192,9 @@ void TraceXYPlot::fromJSON(nlohmann::json j)
} }
auto yauto = jY[i].value("autorange", true); auto yauto = jY[i].value("autorange", true);
auto ylog = jY[i].value("log", false); auto ylog = jY[i].value("log", false);
auto ymin = jY[i].value("min", -120); auto ymin = jY[i].value("min", -120.0);
auto ymax = jY[i].value("max", 20); auto ymax = jY[i].value("max", 20.0);
auto ydiv = jY[i].value("div", 10); auto ydiv = jY[i].value("div", 10.0);
setYAxis(i, ytype, ylog, yauto, ymin, ymax, ydiv); setYAxis(i, ytype, ylog, yauto, ymin, ymax, ydiv);
for(unsigned int hash : jY[i]["traces"]) { for(unsigned int hash : jY[i]["traces"]) {
// attempt to find the traces with this hash // attempt to find the traces with this hash