ghtmtt / DataPlotly

D3 like plots creation with plotly in QGIS
GNU General Public License v2.0
191 stars 50 forks source link

Bar plot difference between standard plugin and print layout plugin #309

Open pedrogeo opened 1 year ago

pedrogeo commented 1 year ago

Hi,

I use the bar plot in the print layout plugin and I notice that the result is not the same with the standard plugin. In the standard plugin, I see the years in the X axis (2020, 2021, 2022) and in the print layout plugin, I see (2019.5, 2020, 2020.5, 2021...).

Is it a bug or a different behaviour between the two plugins ?

The parameters are the same in both cases, the field used in X axis is a text field and the field used in the Y axis is a double field.

Finally, is there a way to change the appearance of the Y labels ? To pass from 15k to 15000 for example ?

Pierre

Standard plugin :

bar_plot_standard

Print layout plugin :

bar_plot_print_layout

ghtmtt commented 1 year ago

I cannot fully confirm your issue. The rendering engine in the print layout might be a little bit different compared to the main plugin one, but I don't see this huge difference.

Are you sure that the x values are datetime? Eventually try to convert them with the to_date (or to_datetime) QGIS function.

With datetime values I've these outputs:

Print layout:

image

Plugin:

image

pedrogeo commented 1 year ago

I tested by converting the field used in X axis to date format but it doesn't work better : date

ghtmtt commented 1 year ago

can you please share your data? even a small subset is ok

pedrogeo commented 1 year ago

Hi,

The file is in attachment below (inside .zip file) :

sample.zip

Pierre