philogb / jit

The JavaScript InfoVis Toolkit provides tools for creating Interactive Data Visualizations for the Web
http://thejit.org
Other
1.51k stars 297 forks source link

Added optional parameter 'id' to JSON #149

Closed bor0 closed 11 years ago

bor0 commented 11 years ago

Added optional parameter 'id' to Jit BarChart, because the previous implementation was not allowing two or more same labels. If an id is not specified, it is using key => value, where key is the label, and for two same labels it would not count the second one. If an id is specified, it will use id => value.

E.g. one can use the following JSON code to display the same label: 'values': [ { 'id':'a', 'label': 'date A', 'values': [20, 40, 15, 5] }, { 'id':'b', 'label': 'date A', 'values': [30, 10, 45, 10] }]