go-echarts / go-echarts

🎨 The adorable charts library for Golang

Home Page:https://go-echarts.github.io/go-echarts/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

请问一下支持echarts针对大规模数据集的参数large:true的设置么?比如scatter的绘制,没找到这个参数

luijianfie opened this issue · comments

Hi @luijianfie , 目前还没有在项目中有这个配置,基于当前go-echarts最新版本(v2.4.0-rc1)的话,可以尝试通过获取echarts instance注入large这个属性解决。

	bar := charts.NewBar()
	const injectLargeAttr = `
      const echartsInstance = %MY_ECHARTS%;
      var option = echartsInstance.getOption();
      if (option.series && option.series.length > 0) {
                 // 获取第一个series设置large,如果多个,需要遍历设置
		option.series[0].large = true; 

	}
      echartsInstance.setOption(option);
`

	bar.AddJSFuncStrs(injectLargeAttr)
        bar.SetGlobalOptions(
		 ....
	)

后面会在go-echarts中加上这个属性。

it works,thanks!!

另外,bar.SetXAxis([]string{"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"}).AddSeries("Category A", generateBarItems()) 这样的添加series的方式,看起来不支持异构图形?比如bar里面增加一条line,有实现的方法么?

Use Overlap.

        line := charts.NewLine()
	bar := charts.NewBar()
        ...
	bar.Overlap(line)