SVG server-side rendering module for Node.js.
You can build pie, bar, scatter and line charts in Node.js.
-
Pie Chart:
chart.pie(data [, config])
{
value: [ 46.6, 38.9, 14.6 ],
color: [ '#FF574D', '#3E8FF1', '#2BC7FF' ],
name: [ 'type 1', 'type 2', 'type 3' ],
unit: '%'
}
-
Bar Chart:
chart.bar(data [, config])
{
series: [
{ data: [
{
xValue: '20',
yValue: 7.3
},
{
xValue: '20~24',
yValue: 31.7
}]
}
],
xAxis: {
type: 'category',
data: [ '20', '20~24', '25~29', '30~34', '35~39', '40' ]
},
yAxis: {
type: 'linear',
data: [ 40, 0 ],
unit: '%'
}
}
-
Scatter Chart:
chart.scatter(data [, config])
{
xAxis:
{ type: 'time',
data:
[ 20170524,
20170525,
...]
},
yAxis:
{ type: 'points',
data: [ 123, 345, ... ]},
series:[
{data:[
{ yValue: 23160,
label: 'sth...',
tooltip: '2017-06-22 23160',
xValue: 20170524 },
{ yValue: 17556,
label: '',
tooltip: '2017-06-23 17556',
xValue: 20170525 }
]}
]
}
-
Line Chart:
chart.line(data [, config])
{
xAxis:
{ type: 'time',
data:
[ 20170524,
20170525,
...]
},
yAxis:
{ type: 'points',
data: [ 123, 345, ... ]},
tooltip: { pointIndex: 14 },
series:[
{
name: '票房',
color: '#010101',
data:[
{ yValue: 3160,
tooltip: '2017-06-22 3160',
xValue: 20170524 },
{ yValue: 7556,
tooltip: '2017-06-23 7556',
xValue: 20170525 }
]},
{data:[
{ yValue: 60000,
tooltip: '2017-06-22 6',
xValue: 20170524 },
{ yValue: 80000,
tooltip: '2017-06-23 8',
xValue: 20170525 }
]}
]
}
-
Area Chart:
chart.area(data [, config])
{
xAxis:
{ type: 'time',
data:
[ 20170524,
20170525,
...]
},
yAxis:
{ type: 'points',
data: [ 123, 345, ... ]},
tooltip: { pointIndex: 14 },
series:[
{data:[
{ yValue: 3160,
tooltip: '2017-06-22 3160',
xValue: 20170524 },
{ yValue: 7556,
tooltip: '2017-06-23 7556',
xValue: 20170525 }
]},
{data:[
{ yValue: 60000,
tooltip: '2017-06-22 6',
xValue: 20170524 },
{ yValue: 80000,
tooltip: '2017-06-23 8',
xValue: 20170525 }
]}
]
}