Export Full Gloss List - warwickfoster/qurantools GitHub Wiki
File: app/charts/chart_verse_lengths.php
Purpose
The provided code snippet is a PHP script that generates a chart of verse lengths for a specific sura in the Quran. It uses the FusionCharts library to create a column chart that displays the number of words in each verse.
Features
- Suras can be selected using a GET parameter
S. - The chart can be sorted by number of words using the
SORTparameter. - There is an option to view the chart in both normal and mini mode.
- The chart includes a legend and hover tooltips.
Functionality
- The script connects to the database and retrieves the verse lengths for the selected sura.
- It generates a JSON data source for the FusionCharts library, which is then used to create the chart.
- The chart is rendered within a
divelement with the IDchartContainer. - The navigation controls allow users to sort the chart and switch between normal and mini mode.
Usage
To use the script, simply include the following files in your web page:
config.phpfunctions.phpauth.phpstandard_header.phpchart_verse_lengths.php
Example
To view the chart for Sura 1, users can navigate to the following URL:
/charts/chart_verse_lengths.php?S=1
Additional Notes
- The script assumes that the database table
QURAN-DATAcontains the necessary data. - The
segmentcolumn is used to determine the beginning of each verse. - The
themeproperty in the JSON data source can be changed to customize the chart theme.