Question

I'm having difficulty getting Django Chartkick to work when using the library option. The application is somewhat complex but briefly when I do not use the library option the chart renders. When I do it does not render.

More specifically this doesn't render:

{% column_chart count_by_type_type with library= {"title":"Super chart",width:"400px"} %}

This does render

{% column_chart count_by_type_type %}

Thanks for any clues as to why and how to fix.

Edit 20140415

width:"400px"

should be

"width":"400px"

However, that does not resolve the issue.

With "width" changed the chart renders with a title and width with Google Charts. When using Highcharts, however, there is no title.

This appears to be a bug in Django Chartkick when using Highcharts. See https://github.com/mher/chartkick.py/issues/13 and comments.

Was it helpful?

Solution

The underlying problem was that I was using the Google Charts API not the Highcharts API. Thanks to Mher Movsisyan the owner of Django Chartkick for a quick answer on Github.

This is his answer for the benefit of other stackoverflow users:

The configuration formats for Google Charts and HighCharts are different. You are trying to apply the Google Charts api to HighCharts.

In this particular example you need to use:

{% pie_chart browser_stats with library={"title":{"text":"Browser Statistics, May 2013"}} %} 

See Highcharts API http://www.highcharts.com/docs/chart-concepts/title-and-subtitle

For a fuller discussion see https://github.com/mher/chartkick.py/issues/13

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top