Finished changes for BarChart and updated CHNAGELOG.

This commit is contained in:
Jakub Sobon 2019-02-14 23:44:11 -05:00
parent 3e8466282e
commit 1ab50bcefc
No known key found for this signature in database
GPG Key ID: F2451A77FB05D3B7
2 changed files with 13 additions and 3 deletions

View File

@ -19,8 +19,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Termbox is now initialized in 256 color mode by default. - Termbox is now initialized in 256 color mode by default.
- Generalized mouse button FSM for use in widgets that need to track mouse - Generalized mouse button FSM for use in widgets that need to track mouse
button clicks. button clicks.
- The constructor of the LineChart widget now also returns an error so that it
can validate its options. This is a breaking change on the LineChart API. #### Breaking API changes
- The constructors of all the widgets now also return an error so that they
can validate the options. This is a breaking change for the following
widgets: BarChart, Gauge, SparkLine, Text. The callers will have to handle
the returned error.
### Fixed ### Fixed

View File

@ -106,6 +106,11 @@ func layout(ctx context.Context, t terminalapi.Terminal) (*container.Container,
), ),
} }
bc, err := newBarChart(ctx)
if err != nil {
return nil, err
}
don, err := newDonut(ctx) don, err := newDonut(ctx)
if err != nil { if err != nil {
return nil, err return nil, err
@ -120,7 +125,7 @@ func layout(ctx context.Context, t terminalapi.Terminal) (*container.Container,
container.Top( container.Top(
container.Border(draw.LineStyleLight), container.Border(draw.LineStyleLight),
container.BorderTitle("BarChart"), container.BorderTitle("BarChart"),
container.PlaceWidget(newBarChart(ctx)), container.PlaceWidget(bc),
container.BorderTitleAlignRight(), container.BorderTitleAlignRight(),
), ),
container.Bottom( container.Bottom(