need help splitting tables or drawing in php

Discussion in 'PHP' started by astojic86, Jul 5, 2009.

  1. #1
    Hey everyone

    I am having a problem hence the post. I am building a market map for the stockmarket.

    I have all the data needed to build the map below.

    however I dont know how to split a large rectangle into many small rectangles as in the link below:

    http://www.smartmoney.com/map-of-the-market/

    I am using PHP,

    does anyone have any ideas how to cut one rectangle into many rectangles and squares?

    Each stock has a market cap, total market cap of all stocks will be the Whole rectangle, then each individual rectangle is a percentage of the total rectangle. But how do i draw this?

    I would prefer to use PHP, but whats the easiest way to do this, i think they built above in JAvascript/
     
    astojic86, Jul 5, 2009 IP
  2. alfa_375

    alfa_375 Active Member

    Messages:
    445
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #2
    My IE is crashing while openning your page.
     
    alfa_375, Jul 5, 2009 IP
  3. astojic86

    astojic86 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hi

    try this link

    http://www.weblink.com.au/html/examples/marketmap.asp

    this is just example of what we are trying to build
     
    astojic86, Jul 5, 2009 IP
  4. exodus

    exodus Well-Known Member

    Messages:
    1,900
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    165
    #4
    Try looking over this and learn more on the gd2 php library.

    I don't recommend it, but you can also do the same with <div> relative/absolute placement using the left/top/z-index/width/height/border/background-color style so they can over lap at the places you want and be the size you want. The good part of this method is you can make each div clickable and pull up using ajax a window displaying information.
     
    exodus, Jul 5, 2009 IP
  5. astojic86

    astojic86 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    its not me that is building this it is a programmer I have hired...

    they said they want to use Tables and CSS,

    I suggested to then GD libraries with imagemap, but they said they wanted to use tables,

    The thing is if you do a mouse over of any of the squares, information should be displayed, eg stock price. like link in my first post.
     
    astojic86, Jul 5, 2009 IP
  6. astojic86

    astojic86 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    every time the Market Map loads, the size of the small rectangles will be different

    the only constant will be the large rectangle that contains all the small rectangles.

    This is due to the market caps changing as share price changes.

    I am not a programmer and I dont think this seems like a massive problem, I dont beleive the solutions is to use tables as it does not seem logical as there is no defined rows or colums as per:

    http://www.weblink.com.au/html/examples/marketmap.asp
     
    astojic86, Jul 5, 2009 IP