django-jchart icon indicating copy to clipboard operation
django-jchart copied to clipboard

Added support for 'hidden' config properties to hide DataSet by default

Open simonc92 opened this issue 7 years ago • 1 comments

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
        }]

simonc92 avatar Nov 19 '18 11:11 simonc92

Coverage Status

Coverage remained the same at 95.354% when pulling f9b2ddc1c3d5646ef898c74af3510199e93904b6 on simon-czychy:master into 2e224f061cdb5804814a6031c4d23899408d62e4 on matthisk:master.

coveralls avatar Nov 19 '18 11:11 coveralls