New issue
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
关于折线图颜色变化问题 #311
Comments
恩,是的,不能使用这种方法实现。这种场景,使用 chart.guide() 辅助元素来实现。 参见 demo: https://codepen.io/Sima/pen/pOdJOm 说明:
我 demo 中直接引入了 https://unpkg.com/@antv/f2@3.2.2/dist/f2-all.min.js |
@simaQ 我引用的是完整版的f2 import f2 from '@antv/f2';
import f2Chart from './components/f2-chart'; |
@simaQ f2版本是3.2.1 |
import f2 from '@antv/f2/lib';
import f2Chart from './components/f2-chart';
require('@antv/f2/lib/component/guide/point'); // 加载 Guide.Point 组件
require('@antv/f2/lib/component/guide/regionFilter'); // 加载 Guide.RegionFilter 组件 |
@simaQ 谢谢,这个我已经看过了,按照api来引入 // require('@antv/f2/lib/component/guide');
require('@antv/f2/lib/component/guide/point'); // 只加载 Guide.Point 组件
require('@antv/f2/lib/component/guide/region-filter'); // 只加载 Guide.RegionFilter 组件
const Guide = require('@antv/f2/lib/plugin/guide');
// 第三步:注册插件 Guide
f2.Chart.plugins.register(Guide); 单独引入这两个依然还是这个错误: import f2 from '@antv/f2';
require('@antv/f2/lib/component/guide');
// require('@antv/f2/lib/component/guide/point'); // 只加载 Guide.Point 组件
// require('@antv/f2/lib/component/guide/region-filter'); // 只加载 Guide.RegionFilter 组件
const Guide = require('@antv/f2/lib/plugin/guide');
// 第三步:注册插件 Guide
f2.Chart.plugins.register(Guide); |
@antv/f2 里面已经注册了 Guide 插件,你只需要按照我刚才给你的引入即可,这里再重复一变: // 统一从 lib 目录下引入!!!!!!!!!!!!!!!!
import f2 from '@antv/f2/lib/index';
require('@antv/f2/lib/component/guide/point'); // 加载 Guide.Point 组件
require('@antv/f2/lib/component/guide/region-filter'); // 加载 Guide.RegionFilter 组件 不需要再 register 了。如果还有错误,你看看是不是 |
@simaQ 感谢感谢,,已经解决了 |
恩,这个文档是我笔误,我更新下,多谢指正。 |
我想实现这个效果
想通过判断改变在条件中的颜色,但是线没有效果,只有点有效果。请问下是什么原因?是不是不能用这个方法实现这种效果,如果是,能不能推荐一种方法呢?
The text was updated successfully, but these errors were encountered: