问题描述
如何在dateset对象中绘制更深的值
例如
option = {
legend: {},tooltip: { show: true,trigger: "item" },xAxis: [
{
type: "category",name: "Quarters",axisTick: { alignWithLabel: true },},],yAxis: [
{
type: "value",name: "Profit/Loss",nameLocation: "center",nameGap: 40,splitLine: { show: false },dataset: [
{
source: [
{
quarter: "2011 Q1",profit: { tooltipValue: 40,plotValue: 50 },loss: { tooltipValue: 40,{
quarter: "2011 Q2",{
quarter: "2011 Q3",{
quarter: "2011 Q4",dimensions: ["quarter","profit","loss"],series: [
{
name: "profit",encode: { x: "quarter",y: "profit.plotValue" },type: "line",datasetIndex: 0,{
name: "loss",y: "loss.plotValue" },};
我正在尝试在encode
中指定更深的值路径,例如encode: { y: "profit.plotValue" }
但是它不起作用
它非常适合[{ profit: 40,loss: 30 }]
和encode: { y: "profit" }
之类的固定值
这在echarts中完全可行吗?
https://echarts.apache.org/examples/en/editor.html?c=line-simple
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)