如何自定义echarts图形?

问题描述

我正在使用flutter echarts。 我想做echarts graphic(矩形,圆形,...),当烛台图按https://trading-terminal.tradingview.com/缩放或滑动时,它会移动并调整大小 节点也可以调整图形大小。

这是我的示例代码

Echarts(
              option: '''
              {
                animation: true,tooltip: {
                      trigger: 'axis',axisPointer: {
                          type: 'line'
                      }
                },grid: [{
                      left: 50,right: 20,top: 110,height: $chartHeight
                },{
                      left: 20,height: ${chartHeight / 2},top:  ${chartHeight * 1.5}
                }],xAxis: [{
                      type: 'category',scale: true,data: ${jsonEncode(xAxisData)},boundaryGap: true,axisLine: {onZero: false},splitLine: {show: false},splitNumber: 20,axisLabel: {
                        formatter: function (value) {
                            return echarts.format.formatTime('MM-dd',value);
                        }
                      },min: 'dataMin',max: 'dataMax',},{
                      type: 'category',gridindex: 1,axisTick: {show: false},axisLabel: {show: false},max: 'dataMax'
                }],yAxis: [{
                      scale: true,{
                      scale: true,splitNumber: 2,axisLine: {show: false},splitLine: {show: false}
                }],dataZoom: [
                      {
                          type: 'inside',xAxisIndex: [0,1],start: 10,end: 100
                      }
                ],graphic: [{
                  type: 'rect',z: 100,left: 'center',top: 'middle',scale: [1.1,1.1],draggable: true,action: 'remove',cursor: 'move',shape: {
                      width: 190,height: 90
                  },style: {
                      fill: 'rgba(188,188,0.3)',linewidth: 2,shadowBlur: 8,shadowOffsetX: 3,shadowOffsetY: 3,shadowColor: 'rgba(0,0.3)'
                  }
                }],series: [
                      {
                      type: 'candlestick',data: $data,itemStyle: {
                          color: '#ef232a',color0: '#14b143',borderColor: '#ef232a',borderColor0: '#14b143'
                      },emphasis: {
                          itemStyle: {
                              color: 'black',color0: '#444',borderColor: 'black',borderColor0: '#444'
                          }
                        }
                      },{
                          name: 'Volume',type: 'bar',data: $volumes,xAxisIndex: 1,yAxisIndex: 1,itemStyle: {
                              color: '#7fbe9e'
                          },encode: {
                              x: 0,y: 5
                          }
                      }
                ]
              }
            ''',)

 

非常感谢。

adding figure in trading terminal

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)