Count Root Position - warwickfoster/qurantools GitHub Wiki

File: app/charts/chart_length_characteristics.php

Purpose

This PHP script generates a line chart that displays the percentage of verses in a specific sura of the Quran with different lengths.

Features

  • Data Source The chart data is retrieved from a database table called QURAN-FULL-PARSE.
  • Chart Type Line chart
  • Chart Title Sura Verse Lengths Characteristics Chart
  • Chart Subtitle
  • X-Axis Verse Length (Words)
  • Y-Axis Percentage of Verses in Sura of This Length
  • Data Points Each data point represents the percentage of verses in the sura with a specific length.
  • Link Each data point can be linked to a verse browser page that shows verses of the specified length.
  • Mini Mode The script provides an option to view the chart in a mini mode, which displays the chart within a smaller container.

Algorithm

  1. Database Query The script queries the database to get the verse lengths and their corresponding counts for the specified sura.
  2. Data Population The script iterates through the database results and populates the chart data with the verse lengths and their percentages.
  3. Chart Rendering FusionCharts JavaScript library is used to render the line chart based on the populated data.

Usage

  • Access the script using a web browser with a GET parameter SURA to specify the desired sura.
  • The chart will be displayed with the percentage of verses for each length.
  • Clicking on a data point will navigate to the verse browser page.

Example URL

charts/chart_length_characteristics.php?SURA=2

Note

  • The script assumes the existence of the necessary database tables and files.
  • The chart_control and print_control files are used for additional chart controls and printing options (not included in this description).