Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Norm plot fix #428

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions analysis/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -583,29 +583,33 @@ function drawLineChart() {

<script type="text/javascript">

var data = new google.visualization.DataTable();
google.setOnLoadCallback(drawLineChart);

data.addColumn('string', 'Date');
data.addColumn('number', 'Norm Query (%)');
function drawLineChart() {
var data = new google.visualization.DataTable();
var data = new google.visualization.DataTable();

<?php
echo "data.addRows(" . count($linedata) . ");";
data.addColumn('string', 'Date');
data.addColumn('number', 'Norm Query (%)');

$counter = 0;
<?php
echo "data.addRows(" . count($linedata) . ");";

foreach ($linedata as $key => $value) {
$counter = 0;

$norm = ($value["full"] == 0 || !isset($value['tweets'])) ? 0 : round($value["tweets"] / $value["full"] * 100);
foreach ($linedata as $key => $value) {

echo "data.setValue(" . $counter . ", 0, '" . $key . "');";
echo "data.setValue(" . $counter . ", 1, " . $norm . ");";
$norm = ($value["full"] == 0 || !isset($value['tweets'])) ? 0 : round($value["tweets"] / $value["full"] * 100);

$counter++;
}
?>
echo "data.setValue(" . $counter . ", 0, '" . $key . "');";
echo "data.setValue(" . $counter . ", 1, " . $norm . ");";

$counter++;
}
?>

var chart = new google.visualization.LineChart(document.getElementById('if_panel_linegraph_norm'));
chart.draw(data, {width:1000, height:190, fontSize:9, lineWidth:1, hAxis:{slantedTextAngle:90, slantedText:true}, vAxis:{minValue:0,maxValue:100}, chartArea:{left:50,top:10,width:850,height:100}});
var chart = new google.visualization.LineChart(document.getElementById('if_panel_linegraph_norm'));
chart.draw(data, {width:1000, height:190, fontSize:9, lineWidth:1, hAxis:{slantedTextAngle:90, slantedText:true}, vAxis:{minValue:0,maxValue:100}, chartArea:{left:50,top:10,width:850,height:100}});

</script>
<div class='svglink'>
Expand Down