mirror of
https://github.com/e107inc/e107.git
synced 2025-08-18 04:12:00 +02:00
Fix for getUsersInClass() query. Chart class experiment (commented out)
This commit is contained in:
@@ -451,8 +451,94 @@ class e_chart
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Toggle Data from clicking on Legend. //FIXME
|
||||
/* $js .= "
|
||||
|
||||
|
||||
// create columns array
|
||||
var columns".$id." = [];
|
||||
// display these data series by default
|
||||
var defaultSeries = [1, 3];
|
||||
var series".$id." = {};
|
||||
for (var i = 0; i < data.getNumberOfColumns(); i++) {
|
||||
if (i == 0 || defaultSeries.indexOf(i) > -1) {
|
||||
// if the column is the domain column or in the default list, display the series
|
||||
columns".$id.".push(i);
|
||||
}
|
||||
else {
|
||||
// otherwise, hide it
|
||||
columns".$id.".push({
|
||||
label: data.getColumnLabel(i),
|
||||
type: data.getColumnType(i),
|
||||
sourceColumn: i,
|
||||
calc: function () {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (i > 0) {
|
||||
columns".$id.".push({
|
||||
calc: 'stringify',
|
||||
sourceColumn: i,
|
||||
type: 'string',
|
||||
role: 'annotation'
|
||||
});
|
||||
// set the default series option
|
||||
series".$id."[i - 1] = {};
|
||||
if (defaultSeries.indexOf(i) == -1) {
|
||||
// backup the default color (if set)
|
||||
if (typeof(series".$id."[i - 1].color) !== 'undefined') {
|
||||
series".$id."[i - 1].backupColor = series".$id."[i - 1].color;
|
||||
}
|
||||
series".$id."[i - 1].color = '#CCCCCC';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function showHideSeries".$id." () {
|
||||
var sel = chart.getSelection();
|
||||
// if selection length is 0, we deselected an element
|
||||
if (sel.length > 0) {
|
||||
// if row is undefined, we clicked on the legend
|
||||
if (sel[0].row == null) {
|
||||
var col = sel[0].column;
|
||||
if (typeof(columns".$id."[col]) == 'number') {
|
||||
var src = columns".$id."[col];
|
||||
|
||||
|
||||
// hide the data series
|
||||
columns".$id."[col] = {
|
||||
label: data.getColumnLabel(src),
|
||||
type: data.getColumnType(src),
|
||||
sourceColumn: src,
|
||||
calc: function () {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
// grey out the legend entry
|
||||
series".$id."[src - 1].color = '#CCCCCC';
|
||||
}
|
||||
else {
|
||||
var src = columns".$id."[col].sourceColumn;
|
||||
|
||||
// show the data series
|
||||
columns".$id."[col] = src;
|
||||
series".$id."[src - 1].color = null;
|
||||
}
|
||||
var view = new google.visualization.DataView(data);
|
||||
view.setColumns(columns".$id.");
|
||||
chart.draw(view, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
google.visualization.events.addListener(chart, 'select', showHideSeries".$id.");
|
||||
";
|
||||
*/
|
||||
|
||||
$js .= "
|
||||
chart.draw(data, options);
|
||||
}
|
||||
|
Reference in New Issue
Block a user