echarts-gl icon indicating copy to clipboard operation
echarts-gl copied to clipboard

Grid3D Axis labels and Axis3D names do not preserve margin/nameGap when data is updated

Open ph0cion opened this issue 6 years ago • 1 comments

Version

1.1.2

Reproduction link

https://jsfiddle.net/ked7uxpL/

Steps to reproduce

The axes label and names change position whenever the data is updated dynamically, for example when using setInterval().

Rotating or zooming out sets them back to the original position temporarily but they get displaced again every time setOption() is called again.

What is expected?

The axes names and labels should always remain in the same position, as specified by the nameGap and margin options

What is actually happening?

The axes names and labels do not preserve the position set by the nameGap and margin options whenever setOption() is called again dynamically.

before setOption() update: Screen Shot 2019-11-11 at 11 57 55

after update: Screen Shot 2019-11-11 at 11 54 05

ph0cion avatar Nov 11 '19 16:11 ph0cion

u can modify src/component/grid3D/Grid3DView.js fix this issue

image

   if (
      Reflect.has(grid3DModel.option, "afterRenderedUpdateAxisPosition") &&
      grid3DModel.option.afterRenderedUpdateAxisPosition
    ) {
      this._updateAxisLinePosition();
    }

ecahrts options

{
  ...,
   grid3D: {
       ...,
      afterRenderedUpdateAxisPosition: true
   }
}

ddtramp avatar Sep 27 '21 03:09 ddtramp