Answer the question
In order to leave comments, you need to log in
How to build the graph shown in the picture?
The graph must be dotted, and so that projections fall onto the OX axis from these points. Just a grid in the background is not an option! All this will need to be inserted into the site.
I looked in Google, there are no such options, other libraries for plotting also did not offer such an option. Tell me, who knows?
-------------------------------------------------- -------------------------------------------------- ---------------------
I solved the problem with svg
Here is the result: sandbox.zz.vc/sandbox/graph
Answer the question
In order to leave comments, you need to log in
Plotting is possible in 2 ways:
1. Using the GD library in PHP, then a couple of lines of code
header('Content-type: image/png');
$image = imagecreatetruecolor(600,250) or die('Cannot create image');
imagefill($image, 0, 0, 0xff8106);
// Задаём толщину линии
imagesetthickness($image, 2);
// строим линию по 4 координатам
imageline($image, 0, 198, 100, 198, 0x000000);
<svg class="graph">
<line x1='50' y1='20' x2='50' y2='350' stroke-width='1' stroke='#ffffff' />
</svg>
Well, as an option - you can build points by hand in where.
Unless, of course, you didn’t skip math at school.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question