antvis / G2Plot

:dango: An interactive and responsive charting library based on G2.
https://g2plot.antv.antgroup.com
MIT License
2.56k stars 607 forks source link

散点图中tooltip参数shared设置为true时,重复的点并没有都显示 #2001

Closed xqb20160824 closed 2 years ago

xqb20160824 commented 3 years ago

散点图中tooltip参数shared设置为true时,重复的点并没有都显示 shared optional boolean true 表示合并当前点对应的所有数据并展示,false 表示只展示离当前点最逼近的数据内容。

hustcc commented 3 years ago

是否有在线的 live demo?

xqb20160824 commented 3 years ago

import { Scatter } from '@antv/g2plot'; let data=[{ category_name:"精酿啤酒", name:"白熊啤酒", x_value:1, y_value:1 },{ category_name:"精酿啤酒11", name:"白熊啤酒11", x_value:1, y_value:1 }] const scatterPlot = new Scatter("container", { appendPadding: 50, data, shared:true, tooltip: { fields: ["x_value", "y_value"], showTitle:true, title:"name", shared:true, }, height: 400, legend: { position: "top", }, xField: "x_value", yField: "y_value", meta: { x_value: { alias: "品类", }, y_value: { alias: "品类1", }, }, shape: "circle", colorField: "category_name", size: 8, yAxis: { min: 0, max:5, nice: true, line: { style: { stroke: "#aaa", }, }, }, xAxis: { min: 0, max:5, grid: { line: { style: { stroke: "#eee", }, }, }, line: { style: { stroke: "#aaa", }, }, },
}); scatterPlot.render();

你好,这是我的配置,你可以复制下,把代码放到:https://antv-g2plot.gitee.io/zh/examples/scatter/basic#color-mapping 可以直接看到效果。我把tooltip参数shared设置为true后,这两个重复的点只显示一个,但是实际上我想让所有的点都可以显示。

xqb20160824 commented 3 years ago

是否有在线的 live demo? import { Scatter } from '@antv/g2plot'; let data=[{ category_name:"精酿啤酒", name:"白熊啤酒", x_value:1, y_value:1 },{ category_name:"精酿啤酒11", name:"白熊啤酒11", x_value:1, y_value:1 }] const scatterPlot = new Scatter("container", { appendPadding: 50, data, shared:true, tooltip: { fields: ["x_value", "y_value"], showTitle:true, title:"name", shared:true, }, height: 400, legend: { position: "top", }, xField: "x_value", yField: "y_value", meta: { x_value: { alias: "品类", }, y_value: { alias: "品类1", }, }, shape: "circle", colorField: "category_name", size: 8, yAxis: { min: 0, max:5, nice: true, line: { style: { stroke: "#aaa", }, }, }, xAxis: { min: 0, max:5, grid: { line: { style: { stroke: "#eee", }, }, }, line: { style: { stroke: "#aaa", }, }, }, }); scatterPlot.render();

你好,这是我的配置,你可以复制下,把代码放到:https://antv-g2plot.gitee.io/zh/examples/scatter/basic#color-mapping 可以直接看到效果。我把tooltip参数shared设置为true后,这两个重复的点只显示一个,但是实际上我想让所有的点都可以显示。

visiky commented 3 years ago

复现 demo: https://codesandbox.io/s/issue-2001-b255j

visiky commented 2 years ago

看了下,tooltip shared 是不作为于散点图的。可以等后续 G2 是否支持

liwanyin commented 2 years ago

这个问题要怎么解决呢?请问