
Live result on the frontend
Video walkthrough
How the example is built, in under two minutes. English audio and subtitles.
What it calculates
A visitor picks a car size, the yearly distance, the years of ownership and the energy prices. The report shows:
- Cheaper option and saving — total cost of ownership with the resale value deducted.
- Break-even point — the year in which the cumulative spend of the electric car drops below the petrol one.
- Three charts — cumulative spending lines, a stacked cost breakdown with its table and a CO2 comparison.
- PDF report — the visitor can download the result as a PDF, charts included.
How it’s built
The form mixes radio buttons, option lists and number fields. The PHP Code holds a small catalogue of typical figures for each car size and fills the arrays used by the charts inside a loop, so the number of points follows the years chosen.
cumulative is a line chart with two series. breakdown is a bar chart with Stacked series and Also show the data table enabled. emissions is a simple bar chart.
The PDF button is enabled: the same charts are drawn in the PDF document, with no extra configuration.
Charts require the Calc Builder version that includes the Charts screen.

The charts as your visitors see them.

The Charts screen: type, data source, labels and data series of each chart.

The Exit Layout: each ##chart_name## tag marks where a chart is drawn.

The PHP Code, which prepares the figures and the arrays used by the charts.

The input form, styled with the Form Layout.
Want this exact example on your own site?
Download the file above, then in your Joomla admin open Components › CalcBuilder › Import and upload it — it’s the same file you’d get from that component’s own Export button, charts included.

CalcBuilder example · Charts · Advanced