diff options
author | Victor Kareh <[email protected]> | 2025-07-22 11:35:10 -0400 |
---|---|---|
committer | Victor Kareh <[email protected]> | 2025-07-22 11:35:10 -0400 |
commit | 8d2ca2d6cc1a08f2dfae4ab194a9c4c73c3dbe1d (patch) | |
tree | f52118198a5fc4140a67ea35bb61156190136929 | |
parent | d68a560f63dbd8c8dd1873cf339e44378a440321 (diff) | |
download | mate-applets-invest-applet-history.tar.bz2 mate-applets-invest-applet-history.tar.xz |
invest: Use array index for x-axisinvest-applet-history
This gives all data points equal spacing and so gaps between market
closures are not shown.
-rw-r--r-- | invest-applet/invest/invest-applet-chart.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/invest-applet/invest/invest-applet-chart.c b/invest-applet/invest/invest-applet-chart.c index 882c86f8..54847715 100644 --- a/invest-applet/invest/invest-applet-chart.c +++ b/invest-applet/invest/invest-applet-chart.c @@ -538,10 +538,7 @@ chart_draw_cb (GtkWidget *widget, cairo_t *cr, InvestChart *chart) chart->chart_data[stock_index].timestamps[j] > 0 && chart->chart_data[stock_index].timestamps[j] < 9999999999) { /* Just to be safe... */ - gint64 current_timestamp = chart->chart_data[stock_index].timestamps[j]; - - gdouble x = 50 + (current_timestamp - min_time) * x_scale; - + gdouble x = 50 + (gdouble)j * (width - 100) / (chart->chart_data[stock_index].data_count - 1); gdouble y = 50 + (max_price - chart->chart_data[stock_index].prices[j]) * y_scale; if (first_point) { |