Comments (4)
Thanks!
Won't it be better to sort your data before calling django-nvd3 ?
I would imagine some peoples could be against a forced sort.
On Mon, Dec 2, 2013 at 11:34 PM, miquelcamprodon
[email protected]:
Hi areski. Great work!
There is an small issue that can be solved with a line of code: The y
series, named y1, y2, y3, ... are located in a dictionary and when data is
read sometimes it is not sorted alphabetically.I suggest to add a sorting after the reading of the y series:
After line 36
y_axis_list = [d for d in series.keys() if 'y' in d]Add
y_axis_list.sort()—
Reply to this email directly or view it on GitHubhttps://github.com//issues/18
.
Kind regards,
/Areski
Arezqui Belaid, [email protected]
Founder at Star2Billing (www.star2billing.com)
Tel: +34650784355
Twitter: http://twitter.com/areskib
LinkedIn: http://www.linkedin.com/in/areski
from django-nvd3.
Hi areski,
Maybe I am not explaining the issue well (or maybe I am missing something), but my problem is that the set of series
y1: the first serie of y points
y2: the second serie of y points
y3: the third serie of y points
is a dictionary and I don't know the way to specify the order of series, as when the keys y1, y2, y3 are readen from the dict not necessarily y1 will appear before y2 and y2 before y3. For that reason I suggest to sort the keys of the dictionary before using them.
For example:
chartdata = {
'x': xdata,
'name1': 'Acepted', 'y1': ydata1, 'kwargs1': kwargs1, 'extra1': extra_serie1,
'name2': 'Not accepted', 'y2': ydata2, 'kwargs2': kwargs2, 'extra2': extra_serie2,
'name3': 'Unknown', 'y3': ydata3, 'kwargs3': kwargs3, 'extra3': extra_serie3,
}
I want to show the series in the specified order, and to ensure this I performed this small change.
from django-nvd3.
Thanks for making this clear, I just pushed your fix 44297a1
from django-nvd3.
To order the keys, use for chartdata a SortedDict() that Django provides. Then create it as explained here: https://code.djangoproject.com/wiki/SortedDict. Note the syntax you need to use to order the keys, it is different from a traditional Python dictionary.
from django-nvd3.
Related Issues (20)
- Documentation is not helpful HOT 3
- Example Error: argument of type 'bool' is not iterable
- Update python-slugify [required: ==1.1.4]
- The chart can't show with error "Uncaught TypeError: a.dispatch.render_start is not a function" HOT 1
- Impossible add more than one tooltip for char
- Multibarchart x axis with text labels does shows NaN% in chart , but gets label correct in tooltip HOT 2
- Separate x for series
- data:87 Uncaught TypeError: chart.tooltipContent is not a function HOT 3
- Doesn't work demo project
- long xAxis Label
- Data from database HOT 2
- Rotate x-axis labels HOT 1
- GET /static/nvd3/build/nv.d3.min.css HTTP/1.1" 404 HOT 1
- Custom Tooltip
- Is that possible for add hyperlink to Chart?
- Getting the error "a.dispatch.render_start is not a function" HOT 4
- NaN% values displayed at x-axis of Multibar chart
- Vertical guideline? HOT 1
- pip install error HOT 3
- NVD3 not displaying the graph HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-nvd3.