Moved to its own issue:
so im testing this, based upon your code and the info in the module I wanted to put together a simple test.
I have a content type called content_type_price that has a price value (decimal) and a time stamp along with the associated product id.. when I add this to a custom block with php input type enabled I dont see the chart ?
<?php
echo "test";
// price
$quant = new stdClass;
$quant->id = 'price';
$quant->label = t('Price History');
$quant->labelsum = TRUE;
$quant->table = 'content_type_price';
$quant->field = 'field_app_date_value';
$quant->query = "SELECT field_app_price_value FROM {content_type_price} WHERE field_product_id_value = 387428400 AND field_app_date_value >= %d";
$quant->dataType = 'single';
$quant->chartType = 'line';
print quant_process($quant, '-1 month');
?>
If i go a query in php my admin i get returned values, of course my sql is adjusted for drupal above..
I get 3 price values returned.
field_app_price_value
5.99
4.99
0.00
I want to show the price over time.. also any way to make it when it says 0.00 that it displays the text "free" instead?
thanks for pointing me to this module hope I can get it working with my block..
I do see my test echo data and the title.. fyi
Comments
Comment #1
mstef commentedWell first, in order to plot over time, you obviously need to be storing timestamps - otherwise, how will the module know of any time..?
Do you have timestamps stored anywhere? If revisions are enabled for the given node type, you might be able to join the cck table with the node_revisions table to pull times...
Comment #2
gateway69 commentedMike,
Here is my query in phpmyadmin for my content type
http://grab.by/8nVT
returns price, and date value which is a unix timestamp, some other fields..
any thoughts?
Comment #3
gateway69 commentedOk i got the graph to show up but its not working like I want to..
I have 4 prices in the db right now, as you can see from the first graph
see screen shot http://grab.by/8o1J with sql debug statements
I have a date range, btw this didnt seem to work for me
I changed it to a unix time stamp
So 4 elements show up in the graph but only go up to 1
I need the chart to be over time, and price and lines from the 4 prices and the dates where the fit in the price..
So bottom is date
Left is prices in this case its 0-5 and lines over time that connect the four prices in a graph..?
here is my sample code that generated the tests, tried multiple and single..
Help! :)
Comment #4
mstef commentedI don't think this is going to work actually..
Quant plots occurrences over time.. it will ignore the field_app_price_value..
Ideally, quant will eventually become class-driven, with each chart-type handler being an included file, each quant object could specify which to use, then you could write a quick class to process this date..
Interesting concept.. maybe I'll put some time towards it.
Comment #5
mstef commentedAnd btw, I'm pretty sure you need the dev version to use strings as dates (eg, '-1 month').
Comment #6
gateway69 commentedMikestefff,
thanks, hmm thats kinda a bummer.. been looking for a solution for some time to plot prices over time.
oh and on the dev thing im using the 6.x.1.x-dev version.. I didnt spend time to trace it down as to why it wouldnt work with -1 month yet tho..
Comment #7
mstef commentedI know this issue is a bit old, but since Quant, at the moment, only works with occurrences over time, I don't think it could do price charts.
Comment #8
hixster commentedI know this issue is closed but I was wondering if there had been any progress on be able to plot field based changes over time.
We've been approached to develop a workflow tool that has to generate reports about how certain content types change over time.
I was planning to use revisions (timestamps) to achieve this with Quant as suggested in post #1.
it would seems that ghazelwood is doing something with CCK values over time here: http://drupal.org/node/919208
Comment #9
mstef commentedSorry, still not way to plot "changes" over time -- only occurrences.