PlotSet LogoPlotSet

How to Create an Online Calculator

A step by step walkthrough for turning a spreadsheet of questions into a published, embeddable calculator in PlotSet, with a formula that computes a result from visitors' answers.

Unos 10 minutos

A short sequence of questions followed by a computed result, such as a score, an estimate or a recommendation, ready to embed on your page: that is what you will have. Each row of a spreadsheet becomes one question, and a formula you write turns the answers into a number.

Expect about ten minutes. Most of it is deciding the questions and the formula, since the template does the rest. Test it with a few known inputs before you publish.

Los datos que necesitas

One row per question with a question text and type, then optional answer options, a default answer, help text, an image URL and extra numeric columns such as a weight.

CSV de ejemplo
question_textquestion_typeanswers_rawfallback_valuecontext_textimageweight_co2
How many miles do you drive per week?number50Include commuting and errands0.4
How often do you fly each year?slider"0101"2Return trips count as two250
What is your diet?dropdownVegan|Vegetarian|Mixed|Meat heavyMixed1
How many people live in your home?rating52
Notas

Question type must be one of text, number, dropdown, date, rating, slider or buttons. Anything else becomes a text box.

For dropdown and buttons, separate options with a pipe. Use label=value to store a value different from the label.

For rating, give the number of icons. For slider, give min,max,step, such as 0,10,1.

Extra numeric columns, such as a weight, are available in the formula as q1_weight, named by question number and column header.

Los pasos

El camino exacto en PlotSet, desde una plantilla en blanco hasta el gráfico terminado.

  1. 01

    Open the Calculator template

    From the PlotSet dashboard, start a new project and choose Calculator from the Other category. It loads with an eight-question sample so you can see every question type working.

    El selector de plantillas de PlotSet: las categorías de gráficos en la columna izquierda, la cuadrícula Bar Charts abierta y la tarjeta de la plantilla Bar Chart con su botón Select visible.
    Todas las guías empiezan aquí. Elige la categoría y luego la plantilla. Es la misma cuadrícula sea cual sea el tipo de gráfico que busques.
  2. 02

    Write your questions

    Give each question a prompt and a type, then add options, a sensible default and a line of help text where it helps. Keep each question short and answerable in one move.

  3. 03

    Upload the file, or connect it live

    Import a CSV or .xlsx file from the data panel, paste rows from a spreadsheet, or connect a Google Sheet so changes to the questions flow through. The first row is read as the headers.

    La vista de datos del editor de PlotSet: una hoja de cálculo con las columnas Name, Value y Region llenas de cifras de provincias canadienses, junto al panel Data, que ofrece subida de CSV, Magic Import y sincronización con Google Sheet.
    La vista de datos, aquí en un proyecto de gráfico de barras. Sube un CSV, saca los números de una imagen con Magic Import o sincroniza una Google Sheet. El panel es el mismo en todos los tipos de gráfico.
  4. 04

    Check the column bindings

    Confirm which column is the question text, type, options, default, help text, image and extra data. This is usually right automatically when the headers are clear.

    El panel de datos de PlotSet con las asignaciones de columnas resaltadas: Label/time apuntando a la columna A, Values a la columna B y Filter/color a la columna C, con el botón Auto Binding debajo.
    Las asignaciones deciden qué columna se convierte en la etiqueta, cuál aporta los valores y cuál define el color. Auto Binding las deduce de tus encabezados, así que revísalas en lugar de darlas por buenas.
  5. 05

    Write the result formula

    Open the Submit and result tab. In the variables box add one name equals expression line per value, referring to answers as q1, q2 and so on. Then write the result text and put the names in double curly brackets.

    El editor de PlotSet en la pestaña Preview: un gráfico de tipo Calculator ya terminado en el lienzo y, a la derecha, el panel de ajustes rodeado por un recuadro rojo.
    La pestaña Preview de un gráfico de tipo Calculator. Todos los controles de estilo están en el panel enmarcado: apariencia, encabezado, pie de página y las opciones propias de este tipo de gráfico, cada grupo en su propia pestaña.
  6. 06

    Choose the flow

    In the Flow and design tab, show one question at a time with Back and Next buttons, or all questions on one page. Style the card, buttons and inputs to match your site.

  7. 07

    Style the question types

    The Question types tab styles each control separately: text and number inputs, dropdowns, rating icons, sliders and button groups.

  8. 08

    Test it, then publish

    Answer every question with known values and check the result against a hand calculation. Then publish and copy the embed code from the Share dialog.

    La barra de herramientas del editor de PlotSet con el botón Share resaltado, justo al lado del botón Export.
    Share es lo que convierte un gráfico terminado en un enlace público y un código de incrustación.

Empieza con la plantilla de Calculator, que ya trae datos de ejemplo cargados, y sustitúyelos por los tuyos.

Abrir la plantilla

Publícalo, incrústalo o expórtalo

El último tramo es igual en todos los tipos de gráfico: Share convierte el gráfico en un enlace público en vivo y un código de incrustación, y Export lo guarda como un archivo estático.

Share: enlace público y código de incrustación

Al activar el código de incrustación y el enlace público, el gráfico queda publicado. El enlace se lo puedes enviar a cualquiera sin problema, y el código de incrustación se coloca en cualquier página como un iframe que conserva los tooltips al pasar el cursor y toda la interactividad. Si editas el gráfico más adelante, haz clic en Recreate para llevar esos cambios a ambos.

La barra de herramientas del editor de PlotSet con el botón Share resaltado, justo al lado del botón Export.
Share es lo que convierte un gráfico terminado en un enlace público y un código de incrustación.
El diálogo Share de PlotSet: el interruptor que activa el código de incrustación y el enlace público, los botones Link, Embed, Facebook, Reddit, Twitter, LinkedIn y Email, y el enlace público del gráfico con un botón Copy.
Activa el código de incrustación y el enlace público, y después copia el enlace o llévate el iframe. Recreate envía las ediciones posteriores a todos los que ya lo tengan.

Export: SVG, PNG o JPG

Export guarda una copia estática en el tamaño que necesites. El SVG se mantiene nítido a cualquier escala y se puede seguir editando en una herramienta de diseño; PNG y JPG son la opción segura para diapositivas y documentos. El multiplicador de escala es lo que te da una imagen nítida en una pantalla retina.

La barra de herramientas del editor de PlotSet con el botón Export resaltado.
Export es el camino hacia un archivo estático para una diapositiva o un informe.
El diálogo Export chart de PlotSet: un selector de escala en 2x, los campos de ancho y alto fijados en 1000 por 600, y el menú de formato abierto con SVG, PNG y JPG.
El SVG se mantiene nítido a cualquier tamaño y se puede seguir editando en una herramienta de diseño; PNG y JPG son la apuesta segura para una presentación. Ajusta la escala antes de exportar para que la imagen se vea nítida en una pantalla retina.

Consejos de estilo para un Calculator

Test with round numbers

Use inputs whose answer you can work out in your head, so a wrong formula is obvious.

Give honest defaults

An untouched question uses its default, so pick the most common answer rather than zero.

Name your variables

Build the result in named steps, such as driving, flights and total, so the formula stays readable.

Format the result

Use the Number and date format tab to set prefixes, suffixes and decimals so the result reads as a cost, a percentage or a weight.

Errores comunes al hacer un Calculator

The result shows zero

A line in the formula is probably malformed, and a bad line silently evaluates to zero. Check the spelling of each name and bracket.

A question appears as a text box

The type was misspelled or missing, so it fell back to text. Check it matches one of the seven types exactly.

The numbers shifted after reordering

Formulas use q1, q2 and so on by sheet order. If you move rows, update the formula.

The exported image does not match the live chart

The static export redraws the current state approximately. Use the live embed for the real experience.

Aprende más sobre el Calculator

¿No estás seguro de que el Calculator sea la opción correcta? Descubre qué es, cuándo usarlo y cuándo no.

Sobre el Calculator

Calculator: preguntas frecuentes

A question text and a question type for each row. Options, defaults, help text, an image and extra numeric columns are optional.

Crea tu Calculator ahora

Gratis para empezar con más de 300 plantillas. No se necesita tarjeta de crédito.