View unanswered posts | View active topics It is currently Fri Mar 01, 2024 2:33 pm



Reply to topic  [ 1 post ] 
pScatterTimeline 
Author Message
New pChart user
New pChart user

Joined: Fri Oct 21, 2011 6:30 pm
Posts: 3
Post pScatterTimeline
Hi all!

I had the need for a timeline in a scatter chart in one of projects, so I made this:
Image

So instead of creating a pScatter, create a pScatterTimeline and do the same with the chart. After "drawScatterScale()" just call "drawScatterTimeline()".
This of course assumes that the xAxis is using unixtime for values.
Options:
'border' = Color and weight of the border surrounding the timeline cells.
'row1' = Color of the first row of the timeline
'row2' = Color of the second row of the timeline
'rowtext1' and 'rowtext2' = Color of the text.
'levels' = This is an array of the different kind of levels that exists. Each level needs
  • 'period' formated for the DateInterval class
  • 'format' A date-format used to round the date to first offset
  • 'outputFormat' How to show the text
  • 'outputfullFormat' Last lines output text
  • 'avgDuration' This is a way to quickly calculate if the level match the chart.
When you add options to drawScatterScale you only need to supply the changed options.

This example will only change the output format for weeks.
Code:
$scatterChart->drawScatterTimeline(array(
   'levels' => array(
      3=>array('outputFormat'=>'v.W',), // level 3 is "week"
   ),
));

The timeline will automatically decide the interval of the timeline (minutes, hour, day, week, month or year)



Update: Timeline calculated wrong date. Sorry. Version 0.1 released and also adding options.


Attachments:
pScatterTimeline.v0.1.zip [1.68 KiB]
Downloaded 820 times


Last edited by onnerby on Tue Oct 25, 2011 5:33 pm, edited 1 time in total.

Fri Oct 21, 2011 6:37 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron