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

Draw a circle with center as given coordinate points (x,y) and given radius using echarts.

Open stuti24sinha opened this issue 2 years ago • 0 comments

Problem Statement : I want to plot a circle with a center as (cx,cy) and a given radius.

Below is the code:

option = { xAxis: { type: 'value', min: 50, max: 500, interval: 100 }, yAxis: { type: 'value', min: 50, max: 500, interval: 100 }, graphic: [ { elements: [ { id: 'small_circle', type: 'circle', z: 100, shape: { // x coordinate for center cx: 150 , // y coordinate for center cy: 350 , // radius r: 50, }, style: { fill: 'rgba(0, 140, 250, 0.5)', stroke: 'rgba(0, 50, 150, 0.5)', lineWidth: 2 } } ] } ], };

Issue : The circle rendered does not have the center (cx,cy). line-simple (1)

Can you help me on how to provide the values for center using options ?

stuti24sinha avatar Dec 21 '22 09:12 stuti24sinha