About Services Tools Blog Contact us

Share Price and Chart

Shows a saved share price, the day's change and a chart over a chosen period on a company site, and works out a market value from the shares in issue.

  • Market Data & Share Prices
  • Mining and exploration
  • Dashboard feature
  • Productised
  • Hybrid
  • 2026

The problem

Investors expect a current price and a simple chart, but asking Yahoo Finance on every page view is slow and breaks when that service limits the site's requests. A chart left as a one-off graphic goes out of date at the next redesign.

What it does

The site fetches a price and chart from Yahoo Finance and saves them briefly, on the server and in the page. The page shows price, change and currency, and a market value from a set share count, or a placeholder when nothing is saved. The chart takes on the site's styling, and the public demo uses sample data.

Outcomes

  • A price badge and a chart no longer ask Yahoo Finance on every view.
  • Day, month and year views come from one saved data series.
  • A market value is worked out from the price and the share count.
  • A warning shows when the latest saved price is a day old.

Simplified mockup

Interactive preview with sample data. Nothing is sent to a server.

Investor header

North Quay Metals
SAMPLE · GBP 42.15 +0.30
Price chart
Day range +0.25 Low 41.74 · High 42.15
Last price
42.15
+0.30 against 41.85 close
Shares outstanding
436,536
configured count
Market value
£18.4m
42.15 × 436,536
Cache fresh · 2 min

Held for 5 minutes. Page views and the header embed read this copy. Host requests today: 14.

Cache is inside the window

Quote cache

TTL 5 min
Age
2 min
Host calls today
14
one write, then hits
Last point
42.15
same session
Today
WhenWhatHost calls
08:01Scheduled write of quote and series1
08:04Homepage header0
08:06Narrow-screen header0
08:11Investors page chart, month range0
08:40Thirteen further page views0
If the cache file is missing
SAMPLE · price unavailable

The header shows a placeholder. It does not call the quote host from the visitor’s browser.

Day-behind cache

North Quay Metals
SAMPLE · GBP 41.85 day behind
Flag stale

Last point is a day behind. The chip stays amber until a fresh quote is written.

Cache age 26 hours · host requests today 14

Fetch
Waiting

How it works

  1. Read the configured symbol and the shares outstanding.
  2. Serve the cached quote when it is still fresh.
  3. Otherwise fetch the quote and the chart series and write the cache.
  4. Draw the chart for the selected range and apply the site styling.
  5. Format the price and a market value, or show a placeholder when the cache is empty.

Pipeline

flowchart LR
  Symbol[Configured symbol] --> Fetch[Yahoo Finance]
  Fetch --> Cache[Short cache]
  Cache --> Price[Price chip]
  Cache --> Chart[Range chart]
  Chart --> Mcap[Market value]