Skip to content

wcharczuk go‐chart Migration Guide

Mike Jensen edited this page Aug 20, 2025 · 7 revisions

This guide explains how to migrate from the archived wcharczuk/go-chart project to the current version of go-analyze/charts, using the included chartdraw package.

Current Fork Status

Users of wcharczuk/go-chart can switch to our project with minimal code changes. The full wcharczuk/go-chart API is available in our chartdraw package.

We have been carefully reviewing wcharczuk/go-chart, adding tests and fixing bugs. API changes have been focused on the root charts package. The chartdraw package has seen minimal changes and will likely remain stable as we expand the charts package. We aim to unify the APIs eventually, but first, we want to fully understand the advantages provided by go-chart.

If you're migrating, we'd love your feedback. Please open an issue to share 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.

Code changes to use our chartdraw package

  • RendererProvider no longer returns an error. You can now call PNG(int, int) or SVG(int, int) to get a Renderer without checking for an error. This change introduces no risk of panics or unchecked errors.

  • Font configuration is no longer defined by top-level fields in Style. Instead, you must initialize a FontStyle struct to define font properties (see PR #15).

  • drawing.ColorFromRGB has been removed. Use drawing.ColorFromRGBA to parse both RGB and RGBA color strings. For more flexibility, charts.ParseColor accepts RGB, RGBA, hex values, and common color names. (See this commit)

Clone this wiki locally