0

was wondering how do I visualize this data in a scatter plot way so it appears in the same Django template page below so that the average price is in the middle as a dot showing the price and the other prices in the list are other smaller dots scattered around it?

Ford    C-MAX   2011    1.6 Diesel  3950    May 7, 2020, 7:28 p.m.
Ford    C-MAX   2011    1.6 Diesel  5250    May 7, 2020, 7:28 p.m.
Ford    C-MAX   2011    1.6 Diesel  16950   May 7, 2020, 7:28 p.m.
Ford    C-MAX   2011    1.6 Diesel  3950    May 7, 2020, 7:32 p.m.
Ford    C-MAX   2011    1.6 Diesel  5250    May 7, 2020, 7:32 p.m.
Ford    C-MAX   2011    1.6 Diesel  5950    May 7, 2020, 7:32 p.m.
Ford    C-MAX   2011    1.6 Diesel  6750    May 7, 2020, 7:32 p.m.
Ford    C-MAX   2011    1.6 Diesel  8950    May 7, 2020, 7:32 p.m.
{'price__avg': 7125.0}

{'price__max': 16950}

{'price__min': 3950}

Note that these values are coming from a query form and results are being drawn from the database so for a different query (e.g. Ford Focus etc. ) these and price values would be different. Basically just looking for a way to visualize the results with emphasis on the average.

Niko
  • 25
  • 6
  • You can do it with plotly. Here is an example how to do: https://www.codingwithricky.com/2019/08/28/easy-django-plotly/ – Renaud May 07 '20 at 20:31
  • @Renaud Thanks, I tried out the example and firstly, I am not sure what to put down for my x / y axis and secondly, I don't know how to implement this for my code and can't seem to find a related how-to. – Niko May 07 '20 at 21:41

0 Answers0