I have the following code:
width, height = 450, 300 -- Pick a width and a height.
lowWidth , higheight = { 1, 450 }, { 1, 300 } -- Find the lowest and highest values in the range
function lineChart( )
row_value = width / ( lowWidth[1] / lowWidth[2] ) / ( higheight[1] / higheight[2] ) -- Divide the width by the amount of values you have for that range to get the width per column
highest_row_value = height / math.random( 100 ) -- Divide the the height by some random number you pick and to get a height per row.
chart_height = ( row_value + highest_row_value )
value = chart_height * (row_value / highest_row_value)-- Calculate the height for your chartvalue by doing chart_height * (row_value / highest_row_value). You can also save the last height to connect the last point with the next point.
dxDrawRectangle( 200, 200, width, height, tocolor( 100, 100, 100, 200 ) )
dxDrawLine( 200, 200, value / highest_row_value, value )
end
addEventHandler( "onClientRender", root, lineChart )