javascript - 如何更改 Chartist html 轴标签的字体特征?
问题描述
根据 Chartist 作者之一的帖子,我实现了将 html 锚元素放入 Y 轴标签的功能。正如建议的那样,我将代码添加到我的 Javascript 源代码中以获取插件,如下所示:
// HTML Label plugin
Chartist.plugins = Chartist.plugins || {};
Chartist.plugins.ctHtmlLabels = function(options) {
return function(chart) {
chart.on('draw', function(context) {
if (context.type === 'label') {
// Best to combine with something like sanitize-html
context.element.empty()._node.innerHTML = context.text;
}
});
}
}
这成功地允许将可导航的 <a> 元素设置到轴标签中。但是,我想将显示的文本链接的字体特征修改为默认的 Times Roman 12 pt 外观。这个怎么做?
解决方案
推荐阅读
- mongodb - mongodump 在无效的 URL 或无法访问的服务器上永远等待
- ruby-on-rails - 过度使用路由自定义 - customize_count (Rails 5)
- django - Django DRF 视图过滤多对多查询集
- python - 在python中将JSON字典转换为JSON数组
- adobe - Adobe体验云登录
- python - 保存 Python 包设置配置以供以后使用
- c++ - 将 Python 嵌入到第三方应用程序回调的 DLL 文件中的问题
- javascript - 这个 javascript 如何在 asp.net 中被调用
- php - Vue-router/Vue.js 和 axios 请求(php 文件下载而不是执行)
- angular - AWS Amplify 和 Angular 7 的 AOT 运行时错误 - 未定义 API