Custom order of points drawing a line
See original GitHub issueHi there folks. @jakevdp I’m happy I found your comment here #689
ordering of points in a line as well. I used that in an example here: 2098f8d
Right now I’m having trouble drawing a line exactly because of the ordering issue. My problem is that I have to specify the ordering by providing the values, more or less like this:
alt.Chart(data).mark_line().encode(
x='x:Q',
y='y:Q',
order=alt.Order('topic:N', sort=['Some Topic', 'Amazing Topic', 'Some Other', 'Minor Topic'])
)
but I’m getting:
altair.vegalite.v2.schema.channels.Order->sort, validating 'anyOf'
['Some Topic', 'Amazing Topic', 'Some Other', 'Minor Topic'] is not valid under any of the given schemas
Is there any workaround for this?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
A Complete Guide to Line Charts | Tutorial by Chartio
Line charts are a fundamental chart type generally used to show change in values across time. Learn how to best use this chart...
Read more >Organize Points and Draw the Line - matlab - Stack Overflow
I've found the right answer (by Gunther Struyf): Sort Coordinates Points in Matlab. In order to visualize the final result just add to...
Read more >Drawing lines from points in QGIS - GIS Stack Exchange
The simplest way is to use the points to create the line. To do this in QGIS use the Points2One plugin. Install this...
Read more >Draw or delete a line or connector - Microsoft Support
Draw a line with connection points · On the Insert tab, in the Illustrations group, click Shapes. Insert Shapes button · Under Lines,...
Read more >EscherSketch
An imperfect tool for drawing and exploring symmetrical patterns and designs. It can export pictures ... line, draws single line segments between two...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Currently you can control the stack order using an
order
encoding, and the legend order using thesort
:When https://github.com/vega/vega-lite/issues/1734 is addressed, this will be easier.
can someone explain how this is solved clearly with example code. I also want to sort the stacked bars in a custom order. Lower stack say is ‘Leave’, Middle stack is ‘Roster’, Upper stack is ‘OT’ for Work Types. just ascending and descending for sort order doesn’t cut it.