@@ -92,7 +92,7 @@ void Sheet::setPlot()
9292 defaultParams.plot .paddingLeft =
9393 Gfx::Length::Emphemeral (45.0 / 12.0 );
9494 }
95- else if (!options->isMeasure (+options->getVerticalChannel ())) {
95+ else if (!options->isMeasure (+! options->getHorizontalChannel ())) {
9696 defaultParams.plot .paddingLeft =
9797 Gfx::Length::Emphemeral (80.0 / 12.0 );
9898 }
@@ -115,11 +115,10 @@ void Sheet::setAxisLabels()
115115 def.position = AxisLabel::Position::max_edge;
116116 def.side = AxisLabel::Side::positive;
117117 }
118- else if (!options->isMeasure (Gen::ChannelId::x )
118+ else if (!options->isMeasure (+options-> getHorizontalChannel () )
119119 && options->getChannels ()
120- .at (Gen::AxisId::x)
121- .hasDimension ()
122- && options->angle == 0 )
120+ .at (+options->getHorizontalChannel ())
121+ .hasDimension ())
123122 def.angle .reset ();
124123}
125124
@@ -154,13 +153,14 @@ void Sheet::setMarkers()
154153 defaultParams.plot .marker .fillOpacity = 0.8 ;
155154 }
156155 else if (options->geometry == Gen::ShapeType::rectangle) {
157- auto vIsMeasure =
158- options->isMeasure (+options->getVerticalChannel ());
159- auto hIsMeasure =
160- options->isMeasure (+options->getHorizontalChannel ());
156+ auto vIsMeasure = options->isMeasure (Gen::ChannelId::y);
157+ auto hIsMeasure = options->isMeasure (Gen::ChannelId::x);
161158 if (auto polar = options->coordSystem .get ()
162159 == Gen::CoordSystem::polar;
163- polar && options->getVerticalAxis ().isEmpty ())
160+ polar
161+ && options->getChannels ()
162+ .at (Gen::ChannelId::y)
163+ .isEmpty ())
164164 defaultParams.plot .marker .rectangleSpacing = 0 ;
165165 else if (auto needRectangleSpacing =
166166 vIsMeasure != hIsMeasure
@@ -221,7 +221,11 @@ void Sheet::setAfterStyles(Gen::Plot &plot, const Geom::Size &size)
221221 auto &style = plot.getStyle ();
222222 style.setup ();
223223
224- if (auto &xLabel = style.plot .xAxis .label ; !xLabel.angle ) {
224+ if (auto &xLabel =
225+ style.plot
226+ .getAxis (plot.getOptions ()->getHorizontalChannel ())
227+ .label ;
228+ !xLabel.angle ) {
225229 auto plotX = size.x ;
226230
227231 auto em = style.calculatedSize ();
0 commit comments