yhsantosa Report post Posted September 25, 2008 I have daily data, and i want to show 1 year data in a narrow x-axis. how can i set the scale of x-axis? i.e: monthly (1 jan, 1 feb, 1 mar, ....., 1 des) but i want those daily data still appear on the 2d line chart. please help me. regards, YH Santosa Share this post Link to post Share on other sites
maglub Report post Posted September 25, 2008 (edited) Hi, I assume you mean that you want daily data to be plotted, but only show the legend on the x-axis for certain values, like 1st of Jan, 1st of Feb. I wanted only 15 values to be shown, but had between 30 - 720 values to be plotted, and solved it like this in PHP: $strXML .= ""; // show only ca 15 dates on the calendar. $show_frequency = $num_days / 15; // create the calendar (catigories) $cur_row = 0; foreach ( $cur_calendar as $cur_day ) { if ($cur_row++%$show_frequency == 0 ) { $cur_display = 1; } else { $cur_display = 0; } $strXML .= ""; $cur_row++; } $strXML .= ""; This produces XML that looks like this: categories category name='2008-03-29' showName='1' / category name='2008-03-30' showName='0' / category name='2008-03-31' showName='0' / category name='2008-04-01' showName='0' / category name='2008-04-02' showName='0' / category name='2008-04-03' showName='0' / category name='2008-04-04' showName='1' / category name='2008-04-05' showName='0' / category name='2008-04-06' showName='0' / ... Sorry for the weird xml, but the forum does not display the code within "<" and ">", weird. This means that you've got a category for each and every "bucket"/date, but only the ones with showName=1 will be visible in your chart. Good luck! //magnus Edited September 25, 2008 by Guest Share this post Link to post Share on other sites
yhsantosa Report post Posted September 26, 2008 thank you very much. it's realy usefull. regards, YH Santosa Share this post Link to post Share on other sites