Skip to main content
Topic: Chart Components (Read 4561 times) previous topic - next topic

Chart Components

PHPRad Chart Components
PHPRad use ChartJS Plugin at its default chart plugin. Learn more about ChartJS https://www.chartjs.org
Used to represent data graphically on a page; Allows you to add charts to a page.

There are various types of chat available to us, which are: Bar Chart, Pie Chart, Line Chart, PolarArea Chat, Doughnut Chart, and Radar Chart.

Adding Chart to a page.

Simply double click or drag and drop any chart component on your page.



Setting Chart Data Sources (Datasets)



Setting Chart datasets design




Setting Chart options

1 After setting the datasets, set the LabelField and ValueField to the corresponding fields name based on the dataset query




Chart Output





Re: Chart Components

Reply #1
Where can i find the controller of the chart?

Re: Chart Components

Reply #2
Hi clarenceeda,

Because the chart component can be used on different pages, the controller is on the SharedController.php File if you are using PHPRad classic. or ComponentController.php if you are using PHPRad Vue

Regards.


Re: Chart Components

Reply #3
Thank you for you reply. and now. For example, by default i have a table named 'Products' which makes

http://localhost/myshop/#/products

This product page have a pie chart with the dataset
 "select brand as label, count(*) as value from products"

Now, how can I make the pie dynamic if the products have category, i.e we have this page below

http://localhost/myshop/#/products/list/category/mobile

and

http://localhost/myshop/#/products/list/category/tablet

I want  dynamic dataset of the Pie like using the ff sql below

"select brand as label, count(*) as value from products where category = 'mobile' ".

How do i do that? and again, thanks.

 

Re: Chart Components

Reply #4
Im using php vuerad trial version

Re: Chart Components

Reply #5

in the classic version the "RandomDifferentColor" does not work in the vuej version it works correctly.