
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
<!-- main.js -->
import IfChart from 'if-charts'
app.use(IfChart)
<!-- App.vue -->
<if-chart @ready="init => ready(init)" height="100px" theme="MileStone" />
setup(){
const DataSet = {
MileStoneData(g) {
g.setGroupV({
'yAxis.data': ['Mon', 'Tue', "Wen"],
'series.0.name': 'MYData',
'series.0.data': [100, 200, 300],
})
},
ChargeTimesData(g) {
g.setGroupV({
'series.0.data': [
{ value: 1048, name: '高峰时段' },
{ value: 735, name: '平时段' },
{ value: 580, name: '低估时段' }]
})
}
}
const ready = (init) => {
let generator = init()
DataSet.MileStoneData(generator)
}
return {ready}
}
| Prop | Desc | Default |
|---|---|---|
| width | 图表宽度 | 100% |
| height | 图表高度,{num}px | 200px |
| options | 用于echarts的option配置 | {} |
| types | 图表加载类型,数组 | ['line', 'bar', 'pie', 'custom'] |
| resize | 布尔值,是否支持resize变化 | true |
| clickEnable | 布尔值,是否支持图表点击 | true |
| theme | 使用echarts主题 | MileStone |
| Event | Desc | Demo |
|---|---|---|
| resize(echart) | 监听resize变化触发 | @resize |
| chartClick | echarts点击事件 | @chart-click |
| ready | 图表ready事件,获取OptionGenerator | @ready |
| Name | Desc | Setting | Demo |
|---|---|---|---|
| MileStone | 里程碑 | {'series.0.name', 'series.0.data'} | |
| ChargeTimes | 时段 | {series.0.data} | |
| ChargePolar | 环形饼图 | {title.0.text, series.0.data} | |
| TrendChart | 折线/柱状图 | {legend.data, xAxis.data, series.0.name, series.0.data, series.1.name, series.1.data} |
ready事件返回一个配置生成器的实例,该实例与图表的option绑定。通过修改实例,自动更新图表。
| Event | Desc | |
|---|---|---|
| setGroupV(obj) | 批量设置option | setGroupV({'series.0.name': 'Data01', 'series.0.name': 'Data02'}) |
| setV(key, value) | 设置单个option | setV('legend.data', ['Data01', 'Data02']) |
FAQs
Charts Option Generator
We found that if-charts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.