Skip to content

Instantly share code, notes, and snippets.

@xuexue
Last active December 15, 2015 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xuexue/5337257 to your computer and use it in GitHub Desktop.
Save xuexue/5337257 to your computer and use it in GitHub Desktop.
var data = { fruits: ['apple', 'banana', 'orange'], values: [100, 120, 85] };
gg.graph(data)
.layer(
gg.layer.bar().map({
'x':'fruits',
'y':'values'
})
).opts({
'title':'Bar Chart with Polychart.js V1',
'dom':'#chart_bar_old',
'width':400,
'height':200
}).render();
var data2 = polyjs.data({fruits: ['apple', 'banana', 'orange'], values: [100, 120, 85] });
polyjs.chart({
layer: {
type: 'bar',
data: data2,
x: 'fruits',
y: 'values'
},
title: 'Bar chart with Polychart.js V2',
dom: 'chart_bar_new',
width: 400,
height: 200
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment