No parameters were removed from KChartWidget. The per-kind drawing lists,
their onAdd* and onRemove* callbacks and isLine still work, so most apps
only need to update the version. Review the following changes.
crosshairOnHover and showScrollToNowButton are now enabled by default.
crosshairOnHoverresponds only to hovering pointers, so it has no effect on touch devices.showScrollToNowButtonshows a button in the bottom-right corner when the chart is scrolled away from the newest candle.
Set either to false to restore the previous behaviour.
toJson is now part of the ChartLine base class; it is required for saving
layouts and for undo history. Build on baseJson, and register a matching
fromJson where you decode drawings:
class MyDrawing extends TwoPointDrawing {
@override
Map<String, dynamic> toJson() => {
...baseJson('myDrawing'),
...anchorsJson(),
};
}Mix in LabelledDrawing or FilledDrawing to enable the editor's label field
or fill slider for your drawing.
These apply only if you imported painters from src/ rather than the public
API:
ChartPaintertakes a singledrawingslist instead of one list per kind.- The crosshair candle is reported through an
emitInfoWindowcallback instead of aStreamSink. MainRenderer.getValueis now the exact inverse ofgetY, which also fixes a small price offset.
ChartLine.hidden defaults to false, so existing drawings remain visible. The
drawing manager uses it to hide drawings.