antvis/G2

Do you want to work on this issue?

You can request for a bounty in order to promote it!

多数据源的柱折混合,悬停提示异常 #6489

Calmio-Y posted onGitHub

问题描述

import { Chart } from '@antv/g2';

const chart = new Chart({ container: 'container', autoFit: true, }); const x1 = [ { period: '二月', year: '2023年', entity: '哈尔滨制罐', bq: 52000.02, dq: 66778, hb: 414.898, mlv: 0.15, sq: 54445, tb: 2373.35, tq: 2150, _origin: { period: '2', year: '2023', entity: 'En10314', }, }, { period: '五月', year: '2023年', entity: '哈尔滨制罐', bq: 73340.3, dq: 103879.430303, hb: 1396.642, mlv: 0.16, tq: 2000, _origin: { period: '5', year: '2023', entity: 'En10314', }, }, { period: '六月', year: '2023年', entity: '哈尔滨制罐', bq: -54394.4, dq: 107223.1, hb: 1233.018, mlv: 0.164, tq: 1950, _origin: { period: '6', year: '2023', entity: 'En10314', }, }, { period: '四月', year: '2023年', entity: '哈尔滨制罐', bq: 72286.2, dq: 100535.760606, hb: 1560.266, mlv: 0.156, tq: 2050, _origin: { period: '4', year: '2023', entity: 'En10314', }, }, { period: '三月', year: '2023年', entity: '哈尔滨制罐', bq: 71232.1, dq: 97192.090909, hb: 251.274, mlv: 0.152, sq: 68887, tq: 2100, _origin: { period: '3', year: '2023', entity: 'En10314', }, }, ]; const x2 = [ { period: '一月', 同期收入: 54418, 本期收入: 0, 事业部: '宝翼制罐', 增长: -5329, 上期收入: null, }, { period: '二月', 同期收入: 50264, 本期收入: 23566, 事业部: '兰州制罐', 增长: -2332.444, 上期收入: -20264.253, }, { period: '五月', 同期收入: 43062, 本期收入: 33333, 事业部: '河北制罐', 增长: -5281, 上期收入: 33333, }, { period: '六月', 同期收入: 82342, 本期收入: 33333, 事业部: '成都制罐', 增长: -6105, 上期收入: 33333, }, { period: '四月', 同期收入: 43062, 本期收入: 33333, 事业部: '两片罐事业部', 增长: -3073, 上期收入: 33333, }, { period: '八月', 同期收入: 43473, 本期收入: null, 事业部: '武汉制罐', 增长: 0, 上期收入: 43473, }, { period: '三月', 同期收入: 65048, 本期收入: 64456, 事业部: '安徽制罐', 增长: -2060, 上期收入: 44444, }, { period: '九月', 同期收入: 56775, 本期收入: -8233, 事业部: '河南制罐', 增长: -5937.2334, 上期收入: 56775, }, { period: '十二月', 同期收入: 43062, 本期收入: 41235, 事业部: '北京制罐', 增长: null, 上期收入: 72355, }, { period: '七月', 同期收入: 79286, 本期收入: 51231, 事业部: '佛山制罐', 增长: -4954, 上期收入: 79286, }, { period: '十月', 同期收入: 100058, 本期收入: 82345, 事业部: '哈尔滨制罐', 增长: 0.55, 上期收入: 100058, }, { period: '十一月', 同期收入: 43062, 本期收入: 25144, 事业部: '沧州制罐', 增长: -5340, 上期收入: 101200, }, ]; chart .interval() .data(x1). encode('x', 'period') .encode('y', 'dq') .encode('color', 'entity'); // chart.data(x1) chart .line() .data(x2) .encode('x', 'period') .encode('y', '上期收入') .encode('shape', 'smooth') .style('stroke', '#fdae6b') .style('lineWidth', 2) .scale('y', { independent: true }) .axis('y', { position: 'right', }); // chart.data(x2) chart.render();

重现链接

No response

重现步骤

No response

预期行为

多数据源的柱折混合,悬停提示正常显示

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

image

补充说明(可选)

No response


Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests