ecomfe / echarts-gl

Extension pack for Apache ECharts, providing globe visualization and 3D plots.
BSD 3-Clause "New" or "Revised" License
2.6k stars 844 forks source link

nice to have timeline in 3D #413

Closed helgasoft closed 2 years ago

helgasoft commented 3 years ago

Could not make scatter3D to work with timeline (+ options). And could not find any examples/documentation on the subject. Maybe no one has ever tried? Would be a great enhancement for the GL library...

Below is the code - copy/paste in the GL-editor.

option = {
        tooltip: {},
        grid3D: {},
        xAxis3D: {},
        yAxis3D: {},
        zAxis3D: {},
  series: [
    {
      type: "scatter3D",
      //coordinateSystem: "cartesian3D",
      name: "1810",
      itemStyle: { opacity: 0.8 },
      symbolSize: 15,
      data: [
        [ 44056, 81.8, 730, 23.97        ],
        [ 43294, 81.7, 659, 35.94        ],
      ],
    },
  ],

  options: [
    {
      type: "scatter3D",
      coordinateSystem: "cartesian3D",
      name: "2015",
      symbolSize: 15,
      data: [
        [ 44056, 81.8, 730, 23.97        ],
        [ 43294, 81.7, 659, 35.94        ],
      ],
    },
    {
      type: "scatter3D",
      coordinateSystem: "cartesian3D",
      name: "1810",
      symbolSize: 10,
      data: [
        [ 1267, 36.9, 557, 1.07, 'Finland', "1810" ],
        [ 1223, 35, 647, 9.92, "Turkey", "1810"    ]
      ],
    }
  ], 
  timeline: {
    axisType: "category",
    top: 1,
    data: ["1810", "2015"]
  } 
};
//myChart.setOption(option);
helgasoft commented 2 years ago

Found a solution, here is the code