ScatterChart
Overview #
Scatter charts are based on basic line charts with the x axis changed to a linear axis. To use a scatter chart, data must be passed as objects containing X and Y properties. The example below creates a scatter chart with 3 points.
Code:
ScatterChart::create(array(
"title"=>"Age and number of phone owned",
"dataSource"=>array(
array("age"=>12,"#phone"=>2),
array("age"=>18,"#phone"=>3),
array("age"=>21,"#phone"=>5),
array("age"=>21,"#phone"=>3),
),
"series"=>array(
array("age","#phone")
)
));
Settings #
name | type | default | description |
---|---|---|---|
name | string | Set name for chart. It is optional | |
title | string | Title of the chart | |
dataSource | mixed | Set the data source for chart, accepting DataStore, DataSource, Process object and even array in table or associate format | |
series | array | List of series, each series is an array containing column name and settings | |
options | array | Extra options for line chart or area chart, please view options section for more details | |
backgroundOpacity | number | 0.5 | Set the opacity for background |
scale | number | 1 | For BubbleChart only, this property set the scale for bubble to fit the size of chart. Please change this to make the point suitable for the size of your chart |
Series property #
Property series
contains list of columns for ScatterChart
and BubbleChart
. ScatterChart will requires 2 columns while BubbleChart requires 3 columns. The adding array at the end will contains settings for the series.
ScatterChart::create(array(
"series"=>array("age","#phone",array(
"label"=>"Age vs Phone",
))
));
BubbleChart::create(array(
"series"=>array("age","#phone",array(
"label"=>"Height, weight vs Phone",
))
));
name | type | default | description |
---|---|---|---|
label | string | Label of the series | |
backgroundColor | string | Background of the point | |
borderColor | string | Border of the point | |
borderWidth | number | Size of point's border | |
pointStyle | string | circle | Style of points.Values: 'circle' , 'cross' , 'crossRot' , 'dash' , 'line' , 'rect' , 'rectRounded' , 'rectRot' , 'star' , 'triangle' |
radius | number | Size of the point | |
hoverBackgroundColor | string | Background of point when hovered | |
hoverBorderColor | string | Border color of point when hovered | |
hoverBorderWidth | number | Border width of the point when hovered | |
hoverRadius | number | Radius of point when hovered | |
hitRadius | number | Additional radius for hit detection | |
scale | number | Scale for the series |
Get started with KoolReport
KoolReport will help you to construct good php data report by gathering your data from multiple sources, transforming them into valuable insights, and finally visualizing them in stunning charts and graphs.