-
Notifications
You must be signed in to change notification settings - Fork 14k
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
Pie Chart - format number display from .3s to .1s ( or other format ) #4424
Comments
You have to read the documentation on how to do your own build. |
You need to use the development version. Files in the assets folder are managed by webpack. You cannot modify using the production server (or debug server). They are minified and Superset loads it from the dist/ subdir, not from the assets directory See https://github.com/apache/incubator-superset/blob/master/CONTRIBUTING.md on how to setup. Maybe an options to .1s can be added in the control defined in assets/javascripts/explore/stores/controls.jsx so it its available for anyone |
@raffas Basically, all I need to do then is run the command line that compiles the production / optimized js & css or do I have to run yarn first? from the root of the repository, move to where our JS package.json lives$ cd superset/assets/ install yarn, a replacement for
|
Yes, you have to run But I suggest you to start from a new virtual env with a fresh cloned copy of superset master, either from the official repository or from your forked copy. I'm unsure if the procedure works on superset installed from python package Note: npm run dev builds all the files that are required, but they are not minified, so some files are about 40M and you you are not on a local lan, you experience some huge delays when you load the various pages. |
I recommend using |
Version 0.28.1 also has this problem pie chart, the d3-format can be configured in metrics of datasource editor, but it does not work. |
Make sure these boxes are checked before submitting your issue - thank you!
Superset version
{"GIT_SHA": "", "version": "0.21.1"}
Expected results
My data are whole integers in my query.
Having decimals does not make sense in this case.
I made search in the source codes and found some formatting in nvd3_vis.js
and a pie chart case.
Steps to reproduce
env/lib/python2.7/site-packages/superset/static/assets/visualizations/nvd3_vis.js
case 'pie':
...
// chart.valueFormat(f);
chart.valueFormat('.1s');
...
else if (fd.pie_label_type === 'key_value') {
//chart.labelType(d =>
${d.data.x}: ${d3.format('.3s')(d.data.y)}
);chart.labelType(d =>
${d.data.x}: ${d3.format('.1s')(d.data.y)}
);}
But the pie charts are still displaying the decimals
Do I need to change anything else?
Thanks in adv.
The text was updated successfully, but these errors were encountered: