We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
var Global = F2.Global; var data = [ {category: "ER", value: 8}, {category: "R", value: 3}, {category:"5%蔓迪", value: 3}, {category: "I", value: 3}, ]; var chart = new F2.Chart({ id: 'mountNode', pixelRatio: window.devicePixelRatio }); chart.source(data); chart.coord({ transposed: true }); chart.axis('action', { line: Global._defaultAxis.line, grid: null }); chart.axis('value', { line: null, grid: Global._defaultAxis.grid, label: function label(text, index, total) { var textCfg = {}; if (index === 0) { textCfg.textAlign = 'left'; } else if (index === total - 1) { textCfg.textAlign = 'right'; } return textCfg; } }); chart.interval().position('category*value'); // 绘制文本 data.map(function(obj) { chart.guide().text({ position: [obj.category, obj.value], content: obj.value, style: { textAlign: 'start' }, offsetX: 10 }); }); chart.render();
The text was updated successfully, but these errors were encountered:
https://github.com/antvis/f2/blob/19a3cc6c9f8061675a8a8acbca6cdb60fd2bd390/src/component/guide/base.js#L52 这段代码解析的问题,以为 position 支持传入百分比,比如 '45%',是个 BUG。需要修复下
Sorry, something went wrong.
fix: Guide 的 position 百分比解析需要考虑原始数据中本身包含 '%'
a69d4ca
的情况.Closed #590.
终于修复了。。。 想问一下pr里的修改是不是少了一个&?
position[0].indexOf('%') !== -1 & !isNaN(position[0].slice(0, -1))
不好意思,丢人了...
fix: Guide 的 position 百分比解析需要考虑原始数据中本身包含 '%' 的情况.Closed #590.
b299390
谁都有手误的时候。。。
simaQ
Successfully merging a pull request may close this issue.
The text was updated successfully, but these errors were encountered: