Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Sql statement for multiple lines in chart
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Sql statement for multiple lines in chart
#21715
Sql statement for multiple lines in chart 12 Years, 5 Months ago Karma: 0
Hello,

I want to have a multi line chart like the one on your demo site.

The data is something like this

Swimstroke Date Time

1 01-01-2011 1,30
1 01-02-2011 1,25
1 01-03-2011 1.26
3 01-01-2011 1,48
3 01-02-2011 1,46
3 01-03-2011 1.50

The Strokes are the lines i want to see in the chart. The date is the x-axe and the time is the y-axe.

The SQL Statement i am using is like this

Code:

Select MeetsDate, TotalTime, Zwemslag from Results
WHERE Results.MembersId=347
ORDER BY  MeetsDate



But i get only one line in the chart but there are 4 swimstrokes in total to show.

Best regards
Robetrt Helthuis
The administrator has disabled public write access.
 
#21719
Re:Sql statement for multiple lines in chart 12 Years, 5 Months ago Karma: 748
Hello,

Try to set "SQL -> Revert data" parameter to "Yes". If it doesn't help, could you provide a link to a page where we can see chart and temporary access to your J! backend by email so we can investigate the issue?

Regards,
ARI Soft
The administrator has disabled public write access.
 
#22080
Re:Sql statement for multiple lines in chart 12 Years, 5 Months ago Karma: 0
Hello,

I succeeded to make the Mysql query so that the data was in the form the chart needed. The magic word was "GROUP_CONCAT".

The problem i am now facing is that if a dataItem has a "NULL" value, The Chart shows a gap in the line (Gchart).

Do you have a solution for this.

Dear regards
Robert Helthuis
The administrator has disabled public write access.
 
#22092
Re:Sql statement for multiple lines in chart 12 Years, 5 Months ago Karma: 748
Hello,

Could you provide a link to a page where we can see a chart and specify what SQL query you use?

Regards,
ARI Soft
The administrator has disabled public write access.
 
#22096
Re:Sql statement for multiple lines in chart 12 Years, 5 Months ago Karma: 0
The chart is on joomla.helthuis.net.

The datatable which is using is shown beneeth the chart.

The SQL statement is:
Code:

 select `Meets`.`MeetsDate` AS `MeetsDate`,
group_concat(if((`Swimstyle`.`Stroke` =1),replace(replace(`Results`.`TotalTime`,':',''),',','.'),'') separator'') AS `Vrij`,
group_concat(if((`Swimstyle`.`Stroke` =2),replace(replace(`Results`.`TotalTime`,':',''),',','.'),'') separator'') AS `Rug`,
group_concat(if((`Swimstyle`.`Stroke` =3),replace(replace(`Results`.`TotalTime`,':',''),',','.'),'') separator'') AS `Vlinder`,
group_concat(if((`Swimstyle`.`Stroke` =4),replace(replace(`Results`.`TotalTime`,':',''),',','.'),'') separator'') AS `Wissel` 
from ((`Results` join `Meets` on((`Results`.`MeetsId` =`Meets`.`MeetsId`))) join `Swimstyle` on((`Swimstyle`.`SwimstyleId` =
`Results`.`StyleId`))) where ((`Results`.`MembersId` = 347) and (`Swimstyle`.`Distance`= 50)) group by `Meets`.`MeetsDate` 
order By MeetsDate DESc limit 25

The administrator has disabled public write access.
 
#22106
Re:Sql statement for multiple lines in chart 12 Years, 5 Months ago Karma: 748
It is possible to replace empty values with 0 value. In this case SQL query will look like:

Code:


select `Meets`.`MeetsDate` AS `MeetsDate`,
group_concat(if((`Swimstyle`.`Stroke` =1),replace(replace(`Results`.`TotalTime`,':',''),',','.'),'0') separator'') AS `Vrij`,
group_concat(if((`Swimstyle`.`Stroke` =2),replace(replace(`Results`.`TotalTime`,':',''),',','.'),'0') separator'') AS `Rug`,
group_concat(if((`Swimstyle`.`Stroke` =3),replace(replace(`Results`.`TotalTime`,':',''),',','.'),'0') separator'') AS `Vlinder`,
group_concat(if((`Swimstyle`.`Stroke` =4),replace(replace(`Results`.`TotalTime`,':',''),',','.'),'0') separator'') AS `Wissel` 
from ((`Results` join `Meets` on((`Results`.`MeetsId` =`Meets`.`MeetsId`))) join `Swimstyle` on((`Swimstyle`.`SwimstyleId` =
`Results`.`StyleId`))) where ((`Results`.`MembersId` = 347) and (`Swimstyle`.`Distance`= 50)) group by `Meets`.`MeetsDate` 
order By MeetsDate DESc limit 25



Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 1