Topic: Questions about charts, labels and JS
 2. How can I add clickable legend to my chart to show/hide graphs? Like here: http://www.highcharts.com/demo/line-basic
Maybee devs have some plans to add native features about this?
I will be very grateful for any information.
2. How can I add clickable legend to my chart to show/hide graphs? Like here: http://www.highcharts.com/demo/line-basic
Maybee devs have some plans to add native features about this?
I will be very grateful for any information.                                                                    
                                                    
                                                    Marta Szymanska
                                                                                        answered 9 years ago                                        
                                                    
                                                    diworm
                                                                                        answered 9 years ago                                        
    //Statistics chart
    $(function () {
        var data = {
            labels: [<?=$data['timeline'];?>],
            datasets: [
                <?=$data['dataset'];?>
            ]
        };
        var option = {
            responsive: true,
            title: {
                display: true,
                text: 'Custom Chart Title'
            },
            legend: {
                display: true,
                position: 'top',
                labels: {
                    fontColor: 'rgb(255, 99, 132)'
                }
            }
        };
        // Get the context of the canvas element we want to select
        var ctx = document.getElementById("statistics").getContext('2d');
        var myLineChart = new Chart(ctx).Line(data, option); //'Line' defines type of the chart.
    });
                                                    
                                                    Marta Szymanska
                                                                                        answered 9 years ago                                        
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
- User: Free
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No