Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

highcharts formatter #59

Open
flavio-pm opened this issue Feb 19, 2018 · 0 comments
Open

highcharts formatter #59

flavio-pm opened this issue Feb 19, 2018 · 0 comments

Comments

@flavio-pm
Copy link

flavio-pm commented Feb 19, 2018

Hello! I'm sorry if this isn't the place to ask, but I wanted to know if chartit supports passing formatter javascript functions to the chart, and if so, how to do so.

I have a two-level donut chart that retrieves data from the database, where each data object carries two distinct numeric values. I'm charting them together on the donut's outer layer with their total in the inner layer, but there's a lot of 0 values clustering at the top of the outer chart (which may, by the way, mean I'm not doing the drilldown right.) Since each zero value may be paired with a non zero value in their data objects, I can't straight up exclude them from the queryset. Google says to use a formatter function in HighCharts that checks the value and returns it only if it's greater than 0:

dataLabels: { formatter:function() { if(this.y != 0) { return this.y; } } }

Problem is, attempting to pass such a function as is conflicts with Python interpretation, and passing it as a string seems to erase the whole chart.

So, yeah, is there a way to pass functions as of now? And if not, can you guys help me figure out what to do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant