Graph Cards are useful for showing users quick data about their funnels including how that funnel compares to previous dates.
Graph Cards will automatically stack on top of each other in narrow columns.
The standard cards are very easy to develop requiring a single
div
and the jQuery code to initialize it:
$('#my-graph').cfGraphCard(myGraphData);
In addition to creating the basic Graph Cards, you can supply your own HTML template (and selectors) if you need to further customize the Card for your display purposes.
This can be achieved by simply providing the HTML inside of the
.ui.graph.card.shadow
element and passing the necessary
selectors in the jQuery call.
If it's more convenient, you can also pass the HTML template using the
template
setting in the jQuery call.
Basic Funnel Graphs can be created with a minimal amount of code. Simply
give your <canvas>
tag an ID and wrap with with a
.ui.graph
container and pass the JavaScript outlined below.
Once you have a reference to a graph, you can then interact with the
graph to highlight()
a specific set of data or
dehighlight()
to reset the graph back to normal.
Try it now by running window.funnelGraph2[0].highlight(2);
in the JavaScript console of your browser. The red graph will move to
the top.
In addition to the easy graphs, rather than passing the
datasets
option, you can instead use the data
option which provides full customization of the graph.
See the Chart.js documentation for more information on the options available.