Halloween Offers

FusionCharts for Dreamweaver - Developer Edition Forum


box FusionCharts for Dreamweaver - Developer Edition
FusionCharts is a Dreamweaver Charting Extension that can be used to render data-driven & animated charts for web applications and presentations. FusionChartsDW is a cross-browser and cross-platform solution that can be used with ASP.VB, PHP, and ColdFusion to deliver interactive and powerful flash charts.

Find out more about FusionCharts for Dreamweaver - Developer Edition

Thread: Formatting dates

title left
User Details
message
title right
Simon Walter

post date:
2010-06-08 11:00:01
HiI've created a line chart with the 'Use data from already defined recordsets', everything works great, I just need to format the date from yyyy-mm-dd to dd-mm-yyyy or even better would be mm-yyAny help would be appreciated.Si
Andrei Rinciog [Extend Studio]

post date:
2010-06-09 06:35:55
Hello Simon, There isn't a parameter that you can set in the interface to set the date format the way you want. But, you can do this directly in the query of the recordset. For your case you will need something like this: SELECT DATE_FORMAT(date,'%m-%y') as date, [other_values]FROM [table]You don't need to make any adjustments to the chart. Tell me if you have more questions. Regards,Andrei Rinciog
Simon Walter

post date:
2010-06-09 07:35:22
Hi, using your Filtering Charts data tutorial I managed to create a recordset that pulled the months names on to the x-axis.In your reply above you've got [other_values] I want the whole table so used [*] which came back as an error, what should I have used?CheersSi
Andrei Rinciog [Extend Studio]

post date:
2010-06-09 07:40:08
Hello, I think that you have to use the names of the other columns. Try that.Regards,Andrei
Simon Walter

post date:
2010-06-09 07:46:58
I've got the date format part to work, but it's not getting any data from the server?Just to complicate things I've got multiple results for each month that I need to add.I think one of your tutorials covers something like that so I'll check.CheersSi
Andrei Rinciog [Extend Studio]

post date:
2010-06-10 03:43:54
Hello Simon, Have you managed to make any progress with this? Can I help you with something? Regards,Andrei
Simon Walter

post date:
2010-06-10 04:17:36
HiI've managed to get to get the date part to work, I need to now use a drop down select with prefilled data to return the data for the chart.EgDrop down menu.123User selects 3 and the data for 3 is returned from the server to populate the chart. Any idea? I'm really stuck.CheersSi
Andrei Rinciog [Extend Studio]

post date:
2010-06-10 05:19:36
Hello Simon, Have you checked this tutorial out http://www.extendstudio.com/dynamic-web-charts-dreamweaver-fusioncharts-developer/Tutorial_Filtering_Charts_data_FusionCharts_Dreamweaver_PHP_%20vars.html? Where are you stuck exactly ? Regards,Andrei Rinciog
Simon Walter

post date:
2010-06-10 10:00:37
HiYes, good tutorial, even I got it to work. I couldn't adapt it to what I'm doing though.I've created recordsets for community, energy and months, where I'm stuck is the SQL for community, energy and months make up the graph and they need to change depending on which community is selected.I've tried;SELECT SUM(electricity), SUM(oil), SUM(gas), SUM(petrol), SUM(diesel)FROM energyGROUP BY var1But it wants var1 to be a column which it isn't.
Andrei Rinciog [Extend Studio]

post date:
2010-06-14 05:30:04
Hello again Simon, The "GROUP BY" statement works only on columns.So, you need to use the community column there. To filter the results depending on the community selected you need a where statement. Something like this: SELECT sum(electricity), sum(oil), sum(gas), sum(petrol), sum(diesel)FROM energyWHERE community = var1GROUP BY communityRegards,Andrei
Simon Walter

post date:
2010-06-14 05:58:35
Excellent, another question I'm afraid, when I've chosen to "Use data from already defined recordsets" is there a way of formatting the date in the code that Fusion Charts generates?I've found this line - $dFCMonthlyenergyaudit->setCategory($rsEnergy, "date", "", "");but don't know what to do with it.Cheers and thanks for your continued support.Si
Andrei Rinciog [Extend Studio]

post date:
2010-06-14 06:10:31
Hello Simon, No, you can't format the date from the code that FusionCharts generates. You have to format it inside the query from the recordset. I've posted above how to do that. Regards,Andrei Rinciog
Simon Walter

post date:
2010-06-14 06:23:23
Sorry, I tried the code above but could'nt get it to work. This is what I tried;$query_rsEnergy = sprintf("SELECT DATE_FORMAT(date,'%m-%y') as date, [electricity]FROM energy WHERE userName = %s",and this was the error message;Warning: sprintf() [function.sprintf]: Too few arguments in C:xampphtdocsEnergy_audit estchart1.php on line 45Query was empty
Andrei Rinciog [Extend Studio]

post date:
2010-06-14 06:35:51
Hello,Please send me a copy of the page at support at extendstudio.comThanks,Andrei
Andrei Rinciog [Extend Studio]

post date:
2010-06-15 03:56:03
Hello, You have to double the percent symbols from the "Date_Format" statement. Like this: $query_rsEnergy = sprintf("SELECT DATE_FORMAT(date,'%%m-%%y') as date, [electricity]FROM energy WHERE userName = %s"Regards,Andrei
Simon Walter

post date:
2010-06-15 08:21:22
Hi thanks for this, I needed to change square brackets to round to get it to work, now I just need to work out how to add another column (eg oil)CheersSi
Simon Walter

post date:
2010-06-15 08:24:23
This works:SELECT electricity, oil, gas, petrol, diesel, DATE_FORMAT(date,'%%m-%%y') as dateFROM energy WHERE userName = %s"Wahoo!!!
Piyush

post date:
2010-08-02 14:49:35
Hi, I have fusion bar chart 3d , it show me wrong date in display , like it is sorting it date wise instead of month wise like 1st column: 01-Aug2nd Column: 02-Aug3rd Column : 10-jul ( 10th july must be before 01-aug )4th Column : 12-Aug 5th Column : 15-Aug6ht Column : 30-07 ( must display after 10-jul and 2nd column ) Please tell me what is solution for this.with best regrads ,Piyush Patel
Andrei Rinciog [Extend Studio]

post date:
2010-08-03 04:19:15
Hello,Do you use the query generator or Dreamweaver recordsets? What date format do you use in the database? Regards,Andrei Rinciog
Piyush

post date:
2010-08-05 09:27:46
Hi , We use default mysql format ( Y-M-D ) and to retrive date we use query in php . With best regards ,Piyush Patel
Andrei Rinciog [Extend Studio]

post date:
2010-08-09 09:58:25
Hello again, We made some tests but everything seems to function correctly. Could you please send us the a sample php page to support at extendstudio.com ? Regards,Andrei Rinciog