Bug 432426 - Legend will not display anything until legend is full if line chart is filled from end
Summary: Legend will not display anything until legend is full if line chart is filled...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kquickcharts
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Arjen Hiemstra
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-02 16:39 UTC by David Redondo
Modified: 2021-02-04 10:23 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Redondo 2021-02-02 16:39:55 UTC
With the new fill mode the legend will only start displaying values once the chart is full.

Probably because the HistoryProxySource shifts the indices back and the legend always reads from 0.
Comment 1 Arjen Hiemstra 2021-02-04 10:23:39 UTC
Git commit 87a80981be218236928e4c7c3bde7e8fe8f41f89 by Arjen Hiemstra.
Committed on 03/02/2021 at 15:16.
Pushed by ahiemstra into branch 'master'.

Add a "first" method to ChartDataSource and use it in Legend

This allows us to get the first valid item from a source. This is
helpful when a source treats its items differently and a request for
item 0 ends up not being a valid item, such as a HistoryProxySource with
FillFromEnd fillMode.

M  +7    -0    src/datasource/ChartDataSource.cpp
M  +2    -0    src/datasource/ChartDataSource.h
M  +8    -0    src/datasource/HistoryProxySource.cpp
M  +2    -0    src/datasource/HistoryProxySource.h
M  +1    -1    src/decorations/LegendModel.cpp

https://invent.kde.org/frameworks/kquickcharts/commit/87a80981be218236928e4c7c3bde7e8fe8f41f89