django-jchart
django-jchart copied to clipboard
Added support for 'hidden' config properties to hide DataSet by default
I wanted to hide a specific dataset inside my django-jchart but hidden wasn't supported.
ValueError at / Use of illegal keyword arguments for DataSet: {'hidden'}
This tiny code enhancement enables this feature. After loading the page the dataset I wanted to be hidden was hidden and you have to click to show the chart.
Code exmple:
from jchart import Chart
class LineChart(Chart):
chart_type = 'line'
def get_datasets(self, **kwargs):
return [{
'label': "My Dataset",
'data': [69, 30, 45, 60, 55],
'hidden': True
}]