A very broad question. If I'm not wrong you are trying to plot a line chart with x-axis as age (umur) from 1 to 60 against y-axis as the average weight (berat) of an age. I can see you are encountering a few problems here.
Identify a type of Chart that suits your requirement. I would suggest to create a Line chart. Take a look at this link and get yourself familiar with Highcharts API.
You need to find yourself a way to query the average weight of age between 1 to 60 from your database. Community here has no clue about your data structure. Refer to the link in step1, click on
VIEW OPTIONS
button and focus onxAxis
andseries
field. You need to construct two JSONs as following.
For your case, JSON format of xAxis
would be something this which lists the age from 1 to 60.
xAxis: {
categories: ['1', '2', '3', '4', '5', ...., '59', '60']
}
Whereas series
is as below which lists out the weights
series: [{
name: 'Weight',
data: [7.0, 6.9, 9.5, 14.5, 18.2, ..., 50.2, 55.3]
}]
So in the end each array of xAxis
and series.data
has total of 60 elements and their values are corresponding to each other.
- Refer to the link in step1 and create the Line chart accordingly in your View.