diff --git a/src/component/axis/AngleAxisView.ts b/src/component/axis/AngleAxisView.ts index d1669fa5fc..32e62b115b 100644 --- a/src/component/axis/AngleAxisView.ts +++ b/src/component/axis/AngleAxisView.ts @@ -138,24 +138,24 @@ const angelAxisElementsBuilders: Record= 0 r: Math.max(ticksCoords[i].coord, 0), - startAngle, - endAngle + startAngle: -angleExtent[0] * RADIAN, + endAngle: -angleExtent[1] * RADIAN, + clockwise: angleAxis.inverse } })); } diff --git a/src/coord/polar/polarCreator.ts b/src/coord/polar/polarCreator.ts index 842a1fc6bb..fe29f3ed18 100644 --- a/src/coord/polar/polarCreator.ts +++ b/src/coord/polar/polarCreator.ts @@ -122,12 +122,10 @@ function setAxis(axis: RadiusAxis | AngleAxis, axisModel: PolarAxisModel) { axis.inverse = axisModel.get('inverse'); if (isAngleAxisModel(axisModel)) { - console.log('coucou') axis.inverse = axis.inverse !== axisModel.get('clockwise'); const startAngle = axisModel.get('startAngle'); - const endAndle = axisModel.get('endAngle') - const actualEndAngle = typeof endAndle === 'number' ? endAndle :startAngle + (axis.inverse ? -360 : 360); - axis.setExtent(startAngle, actualEndAngle); + const endAngle = axisModel.get('endAngle') ?? (startAngle + (axis.inverse ? -360 : 360)); + axis.setExtent(startAngle, endAngle); } // Inject axis instance diff --git a/test/polar-end-angle.html b/test/polar-end-angle.html index 6e55f64a61..3f9849ac19 100644 --- a/test/polar-end-angle.html +++ b/test/polar-end-angle.html @@ -51,20 +51,21 @@

polar with end angle

var data = []; chart.setOption({ + tooltip: {}, angleAxis: [{ type: 'category', polarIndex: 0, - startAngle: 0, - endAngle: 90, + startAngle: 90, + endAngle: 0, data: ['S1', 'S2', 'S3'] },{ type: 'category', polarIndex: 1, - startAngle: 180, - endAngle: 270, + startAngle: -90, + endAngle: -180, data: ['S11', 'S22', 'S33'] }], - radiusAxis: [{ polarIndex: 0},{ polarIndex: 1 }], + radiusAxis: [{ polarIndex: 0},{ polarIndex: 1}], polar: [{},{}], series: [{ type: 'bar',