Пример #1
0
echo GoogleCharts::widget(['visualization' => 'AreaChart', 'options' => ['fontName' => 'PT Sans', 'vAxis' => ['title' => '# of Job Listings
			            	', 'minValue' => 0], 'axisTitlesPosition' => 'out', 'chartArea' => ['left' => '8%', 'right' => '8%'], 'lineWidth' => 5, 'legend' => [], 'height' => '300', 'width' => '70%', 'colors' => ['#427CE3', '#4687A9', '#60CED0', '#B4ECD7', '#718BB2', '#78ACFD'], 'backgroundColor' => '#F0F0F0'], 'dataArray' => $byIndrLine]);
?>
		</div>
	</div>
	<div class="row">
		<div class="col-xs-7 data-module pie-module">
		<div class="row">
			<div class="col-xs-5 col-xs-offset-1">
			<?php 
echo GoogleCharts::widget(['id' => 'my-id', 'visualization' => 'PieChart', 'data' => ['cols' => [['id' => 'industry', 'label' => 'Industry', 'type' => 'string'], ['id' => 'openings', 'label' => 'Openings', 'type' => 'number']], 'rows' => [['c' => [['v' => 'Edu'], ['v' => $lastMonthInd['edu']['num']]]], ['c' => [['v' => 'Health/Med'], ['v' => $lastMonthInd['health']['num']]]], ['c' => [['v' => 'Agric'], ['v' => $lastMonthInd['agr']['num']]]], ['c' => [['v' => 'Engr/Manu/Tech'], ['v' => $lastMonthInd['eng']['num']]]], ['c' => [['v' => 'Business'], ['v' => $lastMonthInd['bus']['num']]]]]], 'options' => ['fontName' => 'PT Sans', 'width' => '100%', 'height' => '100%', 'chartArea' => ['width' => '92%', 'height' => '92%'], 'legend' => ['position' => 'none'], 'colors' => ['#427CE3', '#4687A9', '#60CED0', '#B4ECD7', '#718BB2', '#78ACFD'], 'backgroundColor' => '#F0F0F0'], 'responsive' => true]);
?>
			</div>
			<div class="col-xs-5 col-xs-offset-1">
			<?php 
echo GoogleCharts::widget(['id' => 'an-id', 'visualization' => 'PieChart', 'data' => ['cols' => [['id' => 'industry', 'label' => 'Industry', 'type' => 'string'], ['id' => 'openings', 'label' => 'Openings', 'type' => 'number']], 'rows' => [['c' => [['v' => 'Edu'], ['v' => $industry['edu']['num']]]], ['c' => [['v' => 'Health/Med'], ['v' => $industry['health']['num']]]], ['c' => [['v' => 'Agric'], ['v' => $industry['agr']['num']]]], ['c' => [['v' => 'Engr/Manu/Tech'], ['v' => $industry['eng']['num']]]], ['c' => [['v' => 'Business'], ['v' => $industry['bus']['num']]]]]], 'options' => ['fontName' => 'PT Sans', 'width' => '100%', 'height' => '100%', 'chartArea' => ['width' => '92%', 'height' => '92%'], 'legend' => ['position' => 'none'], 'colors' => ['#427CE3', '#4687A9', '#60CED0', '#B4ECD7', '#718BB2', '#78ACFD'], 'backgroundColor' => '#F0F0F0'], 'responsive' => true]);
?>
			</div>
		</div>
		<div class="row module-row-">
			<div class="col-xs-3 col-xs-offset-2">
				<h4 class="text-center">Last Month</h4>
			</div>
			<div class="col-xs-3">
				<h4 class="text-center">Changes</h4>
			</div>
			<div class="col-xs-3">
				<h4 class="text-center">Today</h4>
			</div>
		</div>
		<div class="row">
Пример #2
0
use common\models\PollRecord;
use fruppel\googlecharts\GoogleCharts;
use yii\helpers\Html;
$this->title = Yii::t('back', 'Poll results');
$this->params['breadcrumbs'][] = ['label' => Yii::t('back', 'Polls'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
$rows = [];
foreach ($model->answers as $pollAnswer) {
    $rows[] = ['c' => [['v' => $pollAnswer->answer], ['v' => $pollAnswer->voices]]];
}
?>

<div>

	<h1><?php 
echo Html::encode($this->title);
?>
</h1>

	<?php 
echo GoogleCharts::widget(['id' => 'chart-id', 'visualization' => 'PieChart', 'data' => ['cols' => [['id' => 'answers', 'label' => Yii::t('back', 'Answers'), 'type' => 'string'], ['id' => 'voices', 'label' => Yii::t('back', 'Voices'), 'type' => 'number']], 'rows' => $rows], 'options' => ['title' => $model->question, 'width' => 600, 'height' => 400], 'responsive' => true]);
?>

	<div style="margin-top: 20px">
	<?php 
echo Html::a(Yii::t('back', 'Close'), ['poll/index'], ['class' => 'btn btn-primary']);
?>
	</div>

</div>
Пример #3
0
<hr>
<?php 
echo GoogleCharts::widget(['id' => 'q11', 'visualization' => 'BarChart', 'dataArray' => [['Aplicação', 'Quantidade'], ['Outlook', 98], ['iCal', 17], ['Mozilla Thunderbird', 4], ['Calendário em Papel', 81], ['Browser (Ex: Gmail, Hotmail, Sapo, Yaoo)', 86], ['Outro', 52]], 'options' => ['title' => '11-Que aplicações usa para gerir/ver o calendário ?', 'width' => 400, 'height' => 300, 'legend' => ['position' => 'none'], 'hAxis' => ['title' => 'Quantidade respostas'], 'vAxis' => ['minValue' => 0]], 'responsive' => true]);
?>
<hr>
<?php 
echo GoogleCharts::widget(['id' => 'q12', 'visualization' => 'BarChart', 'dataArray' => [['Grau Satisfação', 'Quantidade'], ['Nada datisfeito: 1', 0], ['2', 3], ['3', 44], ['4', 105], ['Muito Satisfeito: 5', 54]], 'options' => ['title' => '12-Qual o grau de satisfação que tem sobre as aplicações que usa ?', 'width' => 400, 'height' => 300, 'legend' => ['position' => 'none'], 'hAxis' => ['title' => 'Quantidade de respostas'], 'vAxis' => ['minValue' => 0, 'title' => 'Grau de satisfação']], 'responsive' => true]);
?>
<hr>
<?php 
echo GoogleCharts::widget(['id' => 'q13', 'visualization' => 'ColumnChart', 'dataArray' => [['item', 'Pouca', 'Alguma', 'Importante', 'Bastante', 'Muita', 'Valor ponderado'], ['Ter um calendário para gerir os eventos e tarefas', 28, 40, 61, 63, 68, 88.3], ['Existir uma lista de compras partilhada pelos membros da familia', 71, 48, 67, 42, 32, 69.59999999999999], ['Lista de menus e modo de confecionar refeição', 116, 58, 50, 26, 10, 53.6], ['Envio de mensagens entre membros da família', 57, 46, 78, 54, 25, 74.2], ['Avisos para pagar a luz, gás, telefone, etc', 53, 31, 61, 58, 57, 81.5], ['Saber as principais notícias diárias', 68, 73, 62, 37, 20, 64.8]], 'options' => ['title' => '13-Qual a importância que dá a cada um dos itens, numa perspectiva familiar ?', 'height' => 600, 'vAxis' => ['minValue' => 0, 'title' => 'Quantidade de respostas']], 'responsive' => true]);
?>
<hr>
<?php 
echo GoogleCharts::widget(['id' => 'q14', 'visualization' => 'ColumnChart', 'dataArray' => [['item', 'Pouca', 'Alguma', 'Importante', 'Bastante', 'Muita', 'Valor ponderado'], ['Ter acesso de qualquer lado a esse calendário', 19, 22, 66, 54, 99, 97.2], ['Poder definir eventos privados', 26, 35, 71, 60, 68, 88.90000000000001], ['Ter uma vista personalizada do calendário', 28, 51, 85, 54, 42, 81.09999999999999], ['Poder criar notas com símbolos ou desenho', 38, 72, 68, 51, 31, 74.5], ['Existir um dispositivo em casa para consulta', 34, 46, 74, 59, 47, 81.90000000000001], ['Atribuir tarefas a alguém da família', 21, 36, 85, 73, 45, 86.5], ['Partilhar eventos com outras famílias (pais/filhos)', 76, 55, 53, 44, 32, 68.09999999999999]], 'options' => ['title' => '14-Se a sua família usasse um calendário familiar partilhado por todos os membros do agregado familiar, indicar o grau de importância que dá a cada um dos itens.', 'height' => 600, 'vAxis' => ['minValue' => 0, 'title' => 'Quantidade de respostas']], 'responsive' => true]);
?>
<hr>
<?php 
echo GoogleCharts::widget(['id' => 'q15', 'visualization' => 'PieChart', 'data' => ['cols' => [['id' => 'topping', 'label' => 'Topping', 'type' => 'string'], ['id' => 'slices', 'label' => 'Slices', 'type' => 'number']], 'rows' => [['c' => [['v' => 'Sim'], ['v' => 80.8]]], ['c' => [['v' => 'Não'], ['v' => 19.2]]]]], 'options' => ['title' => '15-Se a sua família tivesse oportunidade de experimentar um calendário grátis para gerir o tempo e tarefas entre outras funcionalidades, experimentaria ?', 'width' => 400, 'height' => 300, 'is3D' => true], 'responsive' => true]);
?>

<hr>
<div style="background-color: white">
    <br>
    <b style="margin-left: 120px;">16-Deixe aqui as suas sugestões sobre alguma funcionalidade ou característica que um calendário familiar devesse ter e que ainda não tenha sido abordado anteriormente.</b>
    <br>
    <br>
 <?php 
echo GridView::widget(['dataProvider' => $obsProvider, 'layout' => '{items}{pager}', 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'txt', 'label' => 'Sugestão']]]);
?>
</div>
Пример #4
0
/* @var $chartOptions array */
/* @var $colWidth string */
use fruppel\googlecharts\GoogleCharts;
use yii\helpers\Html;
use yii\widgets\Pjax;
if ($poll) {
    $cookies = Yii::$app->request->cookies;
    $isVoted = $cookies->getValue('poll_' . $poll->id);
    echo '<div class="row">';
    echo '<div class="col ' . $colWidth . '">';
    echo '<div class="poll">';
    Pjax::begin();
    echo '<div class="row">';
    echo '<div class="col s12">';
    echo '<h3>' . Yii::t('front', 'Poll') . '</h3>';
    echo GoogleCharts::widget($chartOptions);
    echo '</div>';
    echo '</div>';
    if (!$isVoted) {
        echo '<div class="row">';
        echo '<div class="col s12">';
        echo '<button data-target="vote-modal" class="btn modal-trigger"><i class="material-icons right">thumb_up</i>' . Yii::t('front', 'vote') . '</button>';
        echo '<div id="vote-modal" class="modal">';
        echo Html::beginForm('@web/site/vote');
        echo '<div class="modal-content">';
        echo '<h4>' . $poll->question . '</h4>';
        foreach ($poll->answers as $answerPoll) {
            echo Html::radio('answer', false, ['value' => $answerPoll->id, 'id' => 'answer_' . $answerPoll->id]) . ' ' . Html::label($answerPoll->answer, 'answer_' . $answerPoll->id) . '<br />';
        }
        echo '</div>';
        echo '<div class="modal-footer">';