@@ -463,17 +463,28 @@ void PlotBuilder::calcLegendAndLabel(const Data::DataTable &dataTable)
463463 .at (ChannelId::label)
464464 .measure ()) {
465465
466+ auto mainAxisType = plot->getOptions ()->mainAxisType ();
466467 auto subAxisType = plot->getOptions ()->subAxisType ();
467468 auto markerLabelsUnitPercent =
468469 plot->getStyle ().plot .marker .label .unit
469470 == Styles::MarkerLabel::Unit::percent
470- && plot->getOptions ()
471- ->getChannels ()
472- .axisPropsAt (subAxisType)
473- .align
474- == Base::Align::Type::stretch
475- && plot->getOptions ()->labelSeries (subAxisType) == *meas
476- && !plot->getOptions ()->isSplit (subAxisType);
471+ && ((plot->getOptions ()
472+ ->getChannels ()
473+ .axisPropsAt (mainAxisType)
474+ .align
475+ == Base::Align::Type::stretch
476+ && plot->getOptions ()->labelSeries (mainAxisType)
477+ == *meas
478+ && !plot->getOptions ()->isSplit (mainAxisType))
479+ || (plot->getOptions ()
480+ ->getChannels ()
481+ .axisPropsAt (subAxisType)
482+ .align
483+ == Base::Align::Type::stretch
484+ && plot->getOptions ()->labelSeries (subAxisType)
485+ == *meas
486+ && !plot->getOptions ()->isSplit (subAxisType)));
487+
477488 plot->axises .label = {
478489 ::Anim::String{std::string{
479490 markerLabelsUnitPercent
@@ -501,8 +512,7 @@ void PlotBuilder::calcAxis(const Data::DataTable &dataTable,
501512 const auto &meas = *scale.measure ();
502513 if (isAutoTitle) axis.title = dataCube.getName (meas);
503514
504- if (type == plot->getOptions ()->subAxisType ()
505- && axisProps.align == Base::Align::Type::stretch)
515+ if (axisProps.align == Base::Align::Type::stretch)
506516 axis.measure = {{0 , 100 },
507517 meas.getColIndex (),
508518 " %" ,
@@ -568,20 +578,13 @@ void PlotBuilder::addAlignment(const Buckets &buckets,
568578 axisRange.max - halfSize};
569579 }
570580
571- auto subAxisType = plot->getOptions ()->subAxisType ();
572-
573- auto &&subAxisLabel =
574- plot->getOptions ()->labelSeries (subAxisType);
581+ auto &&axisLabel = plot->getOptions ()->labelSeries (axisIndex);
575582 auto markerLabelsUnitPercent =
576583 plot->getStyle ().plot .marker .label .unit
577584 == Styles::MarkerLabel::Unit::percent
578- && plot->getOptions ()
579- ->getChannels ()
580- .axisPropsAt (subAxisType)
581- .align
582- == Base::Align::Type::stretch
583- && subAxisLabel.has_value ()
584- && subAxisLabel
585+ && axisProps.align == Base::Align::Type::stretch
586+ && axisLabel.has_value ()
587+ && axisLabel
585588 == plot->getOptions ()
586589 ->getChannels ()
587590 .at (ChannelId::label)
0 commit comments