Show/hide data lines and columns in google chart (remove column onclick/toogle multiple checkboxes/labels)

How to show and hide lines data in standart google chart?
Example of chart build:

google.charts.load('current', {'packages': ['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
    var data = google.visualization.arrayToDataTable([
        ['Year', 'Sales', 'Expenses'],
        ['2013', 1000, 400],
        ['2014', 1170, 460],
        ['2015', 660, 1120],
        ['2016', 1030, 540]
    ]);

    var columns = [];
    var series = {};
    for (var i = 0; i < data.getNumberOfColumns(); i++) {
        columns.push(i);
        if (i > 0) {
            series[i - 1] = {};
        }
    }

    var options = {
        title: 'Chart title',
        vAxis: {minValue: 0},
        tooltip: {trigger: 'selection'},
        aggregationTarget: 'category',
        series: series
    };

    var chart = new google.visualization.AreaChart(document.getElementById('chart_div'));
    chart.draw(data, options);

    google.visualization.events.addListener(chart, 'select', function () {
        var sel = chart.getSelection();
        if (sel.length > 0) {
            if (sel[0].row === null) {
                var col = sel[0].column;
                if (columns[col] == col) {
                    columns[col] = {
                        label: data.getColumnLabel(col),
                        type: data.getColumnType(col),
                        calc: function () {
                            return null;
                        }
                    };
                    series[col - 1].color = '#CCCCCC';
                }
                else {
                    columns[col] = col;
                    series[col - 1].color = null;
                }
                var view = new google.visualization.DataView(data);
                view.setColumns(columns);
                chart.draw(view, options);
            }
        }
    });
}

How to create/use Joomla! editor? JFactory::getEditor()

Example (short version in J!3.x)

$default_value = JFactory::getApplication()->input->get('your_field_name','');
$editor = JFactory::getConfig()->get('editor');
$editor = JEditor::getInstance($editor);
echo $editor->display( 'your_field_name', $default_value, 250, 250, 20, 20);

In Joomla! 2.5 the parameters list for the display() function has been lengthened, so to use specific display parameters in 2.5:

$editor =& JFactory::getEditor();
$params = array( 'smilies'=> '0' , 'style'  => '1' , 'layer'  => '0' , 'table'  => '0' ,'clear_entities'=>'0' );
echo $editor->display( 'desc', '', '400', '400', '20', '20', false, null, null, null, $params );

Allow html code in JRequest

How to create HTML select lists in Joomla!

If you need create some HTML select list with items then you can use Joomla API.
Joomla! provide special class JHTML for creating form elements, such as selectlist, radiolist, booleanlist and etc…
Most popular. Get data from database and create selectlist.
Example ↓

$selected = JFactory::getInt('selectlist_name', 0); 

$db = JFactory::getDBO();
    $query = "SELECT `id` AS `value`, `title` AS `text` FROM `#__your_table` WHERE `cid`=1";
$db->setQuery($query);
$items_from_db = $db->loadObjectList();

$selectlist_data[] = JHTML::_('select.option',  '0', "- Select item -", 'value', 'text' );
$selectlist_data = array_merge( $selectlist_data, $items_from_db);

$list = JHTML::_( 'select.genericlist',
                    $selectlist_data, 
                    'selectlist_name', 
                    'size="1" class="inputbox selectlist"', 
                    'value', 'text', 
                    $selected, 'selectlist_id', 
                    true
);
echo $list;

Result ↓