Skip to content

Commit

Permalink
fix: 1.x bugfix (#1505)
Browse files Browse the repository at this point in the history
* fix: fix groupedColumn-line axis title overlap bug

* fix: support tooltip formatter for funnel

* chore: update version

* chore: update changelog
  • Loading branch information
lessmost authored Aug 31, 2020
1 parent 7dbe86a commit 16aee80
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## <small>1.1.25 (2020-08-31)</small>

* docs(waterfall): 修复瀑布图文档, 更新 tooltip 使用方式 (#1492) ([7dbe86a](https://github.com/antvis/g2plot/commit/7dbe86a)), closes [#1492](https://github.com/antvis/g2plot/issues/1492)
* fix: fix groupedColumn-line axis title overlap bug ([096ee6a](https://github.com/antvis/g2plot/commit/096ee6a))
* fix: support tooltip formatter for funnel ([8505483](https://github.com/antvis/g2plot/commit/8505483))

## <small>1.1.23 (2020-08-11)</small>

* fix: 修复全 0 数据饼图 spider 布局 label 报错的问题 (#1416) ([c3fc10c](https://github.com/antvis/g2plot/commit/c3fc10c)), closes [#1416](https://github.com/antvis/g2plot/issues/1416)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g2plot",
"version": "1.1.24",
"version": "1.1.25",
"description": "An interactive and responsive charting library",
"keywords": [
"chart",
Expand Down
2 changes: 1 addition & 1 deletion src/combo/groupedColumn-line/layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const defaultYAxisConfig = {
title: {
autoRotate: true,
visible: false,
offset: 12,
spacing: 12,
},
};

Expand Down
17 changes: 17 additions & 0 deletions src/plots/funnel/layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,23 @@ export default class FunnelLayer<T extends FunnelLayerConfig = FunnelLayerConfig
this.adjustFunnel(funnel);
this.funnel = funnel;
this.setConfig('geometry', funnel);
if (!props.compareField) {
this.geometryTooltip();
}
}

protected geometryTooltip() {
this.funnel.tooltip = {};
const tooltipOptions = this.options.tooltip;
if (tooltipOptions.fields) {
this.funnel.tooltip.fields = tooltipOptions.fields;
}
if (tooltipOptions.formatter) {
this.funnel.tooltip.callback = tooltipOptions.formatter;
if (!tooltipOptions.fields) {
this.funnel.tooltip.fields = [this.options.xField, this.options.yField];
}
}
}

protected animation() {
Expand Down

0 comments on commit 16aee80

Please sign in to comment.