Skip to content

Commit ed0b8d5

Browse files
committed
Add axis range on split chart
1 parent 735f33d commit ed0b8d5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/chart/generator/plotbuilder.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,18 @@ PlotBuilder::addSeparation(const Buckets &buckets,
572572
auto maxRange = Math::Range<>{{}, {}};
573573
for (auto &resItem : res) {
574574
if (!resItem.enabled) continue;
575+
576+
auto onlyPositive = !std::signbit(resItem.containsValues.min);
577+
plot->getOptions()->setAutoRange(onlyPositive,
578+
onlyPositive,
579+
true);
580+
581+
resItem.containsValues =
582+
plot->getOptions()
583+
->getChannels()
584+
.at(axisIndex)
585+
.range.getRange(resItem.containsValues);
586+
575587
max = max + resItem.containsValues;
576588
maxRange.include(resItem.containsValues);
577589
}

0 commit comments

Comments
 (0)