hexo-plugin-apache-echarts
v1.0.2
Published
A Hexo plugin for rendering Apache ECharts diagrams in blog posts
Maintainers
Readme
Hexo Plugin Apache ECharts
A Hexo plugin for rendering Apache ECharts diagrams in your blog posts.
Installation
npm install hexo-plugin-apache-echartsConfiguration
Add the following configuration to your _config.yml:
echarts:
enable: true
js_url: 'https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js'
id_generation: 'random' # 'random' for performance, 'hash' for consistency
priority: 0 # Filter execution priorityConfiguration Options
enable: Enable/disable the plugin (default:true)js_url: CDN URL for ECharts library (default: jsdelivr CDN)id_generation: ID generation method (default:'random')'random': Generate random IDs for better performance'hash': Generate hash-based IDs from chart content for consistency
priority: Filter execution priority (default:0). Lower values run first
Usage
Use the echarts tag in your markdown files:
{% echarts %}
{
title: {
text: 'Sample Chart'
},
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [{
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar'
}]
}
{% endecharts %}Features
- Interactive client-side charts
- CDN-based ECharts library loading
- Configurable ID generation (random or hash-based)
- Automatic ECharts script injection
- Support for all ECharts chart types
Development
Testing
Run the test suite:
npm testContributing
- Fork the repository
- Create your feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
License
MIT
