ngx-echarts
ngx-echarts copied to clipboard
Draw a circle with center as given coordinate points (x,y) and given radius using echarts.
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).
Can you help me on how to provide the values for center using options ?