Forum - jschmidt-systemberatung.de

× php-RGraph and php-rgraph Joomla Content Plugin

Diagramm mit Datenbankabfrage

  • Luma
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 5 months ago - 5 years 5 months ago #1136 by Luma
Diagramm mit Datenbankabfrage was created by Luma
Hallo,
ich habe, wie hier in den Beispielen, erfolgreich ein Diagramm generiert, welches die meistgelesenen Beiträge anzeigt. Nun hätte ich gern ein weiteres Diagramm, was die Anzahl Beiträge pro Jahr einer bestimmten Kategorie ausgibt. Bisher habe ich das immer händisch aktualisiert, was aber recht mühsam ist, da es ja möglichst aktuell sein soll. Wie wäre der Code solch einer Datenbankabfrage?
So soll es aussehen: www.gso-hef.de/news/statistiken.html#news
Vielen Dank im voraus.
Last edit: 5 years 5 months ago by Luma.

Please Log in or Create an account to join the conversation.

  • Luma
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 4 months ago #1137 by Luma
Replied by Luma on topic Diagramm mit Datenbankabfrage
Mit einigen Hilfen bin ich nun selbst auf die Lösung gekommen. Die Abfrage muss lauten:
SELECT YEAR(`created`), count(*)  
FROM `jos_content`
WHERE `catid` = deine_cat_id
GROUP BY YEAR(`created`)

Please Log in or Create an account to join the conversation.

  • Luma
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 3 months ago - 5 years 3 months ago #1153 by Luma
Replied by Luma on topic Diagramm mit Datenbankabfrage
Ein Problem ist inzwischen noch aufgetaucht. Mit tooltip="#val# Beiträge" wird der Wert plus den Zusatz "Beiträge" angezeigt. Falls nur ein Beitrag vorhanden ist, sieht aber "1 Beiträge" unschön aus. Wie kann ich erreichen, dass in diesem Fall "1 Beitrag" angezeigt wird?
Last edit: 5 years 3 months ago by Luma.

Please Log in or Create an account to join the conversation.

Time to create page: 0.147 seconds
Powered by Kunena Forum
We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.