-
Notifications
You must be signed in to change notification settings - Fork 2
wcharczuk go‐chart Migration Guide
This page serves as the migration guide for updating from the archived wcharczuk/go-chart
project to the current version of go-analyze/charts
. Once complete, future update instructions will be provided in the go-analyze/charts
Version Migration Guide.
Users of wcharczuk/go-chart
can switch to our project with minimal code changes and render their graphs in the same way they have been. The entire contents of wcharczuk/go-chart
are included under the chartdraw
package.
We have been carefully reviewing wcharczuk/go-chart
, focusing on adding testing and fixing bugs. Our efforts have primarily targeted the API under the charts
package, so changes to our chartdraw
package have been minimal. Eventually, we aim to unify the APIs, but first, we want to ensure we clearly understand the advantages provided by go-chart
.
If you're migrating, we would love to hear from you. Open an Issue and tell us what you liked about wcharczuk/go-chart
, as well as anything you do or do not like about our charts
configuration or the styling of our graphs.
-
RendererProvider
no longer returns an error. CallingPNG(int, int) Renderer
orSVG(int, int) Renderer
to construct a Renderer now can be done without needing to check for any errors. There is no risk of panic or unchecked errors in this change. -
Font
configuration has been moved out as top-level fields ofStyle
and instead requires theFontStyle
struct to be initialized to define font specifics (see PR #15). -
drawing.ColorFromRGB
has been deprecated. Usedrawing.ColorFromRGBA
to parse both RGB and RGBA strings. A more flexible parsing API is also available fromcharts.ParseColor
, accepting RGB, RGBA, hex, and common color names. (See this commit)