Charts

    Since phpMyAdmin version 3.4.0, you can easily generate charts from a SQL query by clicking the “Display chart” link in the “Query results operations” area.

    A window layer “Display chart” is shown in which you can customize the chart with the following options.

    • Chart type: Allows you to choose the type of chart. Supported types are bar charts, column charts, line charts, spline charts, area charts, pie charts and timeline charts (only the chart types applicable for current series selection are offered).
    • Series: Allows to choose series for the chart. You can choose multiple series.
    • Title: Allows specifying a title for the chart which is displayed above the chart.
    • X-axis and Y-axis labels: Allows specifying labels for axes.

    _images/chart.png

    Charts in phpMyAdmin are drawn using jqPlot jQuery library.

    Examples

    Query results for a simple pie chart can be generated with:

    Choosing expense as the X-axis and amount in series:

    Both bar charts and column chats support stacking. Upon selecting one of these types a checkbox is displayed to select stacking.

    Query results for a simple bar or column chart can be generated with:

    And the result of this query is:

    Choosing title as the X-axis and rental_rate and replacement_cost as series:

    Scatter charts are useful in identifying the movement of one or more variable(s) compared to another variable.

    Using the same data set from bar and column charts section and choosing replacement_cost as the X-axis and rental_rate in series:

    _images/scatter_chart.png

    These charts can be used to illustrate trends in underlying data. Spline charts draw smooth lines while timeline charts draw X-axis taking the distances between the dates/time into consideration.

    Query results for a simple line, spline or timeline chart can be generated with:

    And the result of this query is: