You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there,
I've been trying to stack datas on the same bar in a bar chart but keep failing, has anyone ever tryed this option?
Below is my code in my controller:
Here is my query:
public function getQueryForTotalPerSeason(): string
{
return "SELECT case when subscriber.gender= 'H' then count(subscription.subscriber) else 0 end AS totalMale,
case when subscriber.gender= 'F' then count(subscription.subscriber) else 0 end AS totalFemale,
season.name AS seasonName
FROM App\Entity\Subscription subscription
JOIN App\Entity\Season season
WITH season.id=subscription.season
JOIN App\Entity\Subscriber subscriber
WITH subscriber.id=subscription.subscriber
GROUP BY seasonName, subscriber.gender";
}
I have tryed to 'stacked : true' only on xAxes, only on yAxes, on both , I also tryed to add stack in the addDataSet:
->addDataSet('totalFemale', 'Femmes', [
"backgroundColor" => self::TOTAL_PALETTE_F,
"stack" => "0"
])
But nothing seems to work, I keep having 2 bars side to side, with a duplicate seasonName under each of them.
May this option not be available in this library?
Many thanks for your help
The text was updated successfully, but these errors were encountered:
Hi there,
I've been trying to stack datas on the same bar in a bar chart but keep failing, has anyone ever tryed this option?
Below is my code in my controller:
Here is my query:
public function getQueryForTotalPerSeason(): string
{
return "SELECT case when subscriber.gender= 'H' then count(subscription.subscriber) else 0 end AS totalMale,
case when subscriber.gender= 'F' then count(subscription.subscriber) else 0 end AS totalFemale,
season.name AS seasonName
FROM App\Entity\Subscription subscription
JOIN App\Entity\Season season
WITH season.id=subscription.season
JOIN App\Entity\Subscriber subscriber
WITH subscriber.id=subscription.subscriber
GROUP BY seasonName, subscriber.gender";
}
I have tryed to 'stacked : true' only on xAxes, only on yAxes, on both , I also tryed to add stack in the addDataSet:
->addDataSet('totalFemale', 'Femmes', [
"backgroundColor" => self::TOTAL_PALETTE_F,
"stack" => "0"
])
But nothing seems to work, I keep having 2 bars side to side, with a duplicate seasonName under each of them.
May this option not be available in this library?
Many thanks for your help
The text was updated successfully, but these errors were encountered: